Boa Tarde.
Estou tendo um problema no servidor websphere 8.5,onde não estou conseguindo fazer uma requisição para uma action(Struts 1.3).
O engraçado que ao rodar no websphere 6.1 funciona normalmente.
No console da applet da esta exceção.
java.lang.RuntimeException: java.io.IOException: Server returned HTTP response code: 500 for URL: http://localhost:9081/Projeto/impressora.do
at br.com.stefanini.projeto.applet.http.WebTarget.postReturnByteArray(WebTarget.java:75)
at br.com.stefanini.projeto.applet.http.WebTarget.postReturnString(WebTarget.java:33)
at br.com.stefanini.projeto.applet.http.BasePrinterHttpApplet.retriveSavedConfiguredPrinter(BasePrinterHttpApplet.java:36)
at br.com.stefanini.projeto.applet.printer.PrinterConfigurationApplet.configurePrinters(PrinterConfigurationApplet.java:105)
at br.com.stefanini.projeto.applet.printer.PrinterConfigurationApplet.init(PrinterConfigurationApplet.java:74)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: Server returned HTTP response code: 500 for URL: http://localhost:9081/Projeto/impressora.do
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at br.com.stefanini.projeto.applet.http.WebTarget.postReturnByteArray(WebTarget.java:61)
... 6 more
E no console do servidor joga essa exceção
Caused by: java.lang.NoSuchMethodException: Action[/login] does not contain specified method (check logs)
at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:261)
at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:170)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:425)
... 51 more
[15/03/13 12:07:51:021 BRT] 00000086 DispatchActio E org.apache.struts.actions.DispatchAction dispatchMethod Action[/login] does not contain method named 'verificarImpressorasConfiguradas'
não sei por qual motivos a applet não faz a requisição para
http://localhost:9080/Projeto/impressora.do?acao=verificarImpressorasConfiguradas
mas sim para a action welcome-file do web.xml login.do
esse é o trecho que a applet faz a requisição.
HttpURLConnection connection = null;
try {
String postParametersData = getPostParametersData();
URL url = new URL(uri);
connection = (HttpURLConnection) url.openConnection();
connection.setDoOutput(true);
connection.setDoInput(true);
connection.setInstanceFollowRedirects(false);
connection.setRequestMethod("POST");
connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
connection.setRequestProperty("charset", UTF_8);
connection.setRequestProperty("Content-Length", "" + Integer.toString(uri.getBytes().length + postParametersData.getBytes().length));
connection.setUseCaches(false);
connection.setRequestProperty("Cookie", "JSESSIONID=" + jSessionId);
DataOutputStream wr = new DataOutputStream(connection.getOutputStream ());
wr.writeBytes(postParametersData);
wr.flush();
wr.close();
InputStream iss = connection.getInputStream();//ACONTECE AQUI A EXCEÇÃO
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
int c;
while ((c = iss.read()) != -1) {
byteArrayOutputStream.write(c);
}
//ByteArrayInputStream byteArrayInputStream = null;
//byteArrayInputStream = new ByteArrayInputStream(byteArrayOutputStream.toByteArray());
byte[] line = byteArrayOutputStream.toByteArray();
connection.disconnect();
return line;
} catch (IOException e) {
e.printStackTrace();
e.getMessage();
throw new RuntimeException(e);
} finally {
if (connection != null)
connection.disconnect();
}
Alguém sabe o que pode estar acontecendo ?