2

当我尝试从使用部署在 tomcat 7 上的 GWT 编写的服务器 java 调用 Web 服务时,出现此错误:

java.lang.NumberFormatException: For input string: ""
at java.lang.NumberFormatException.forInputString(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at org.apache.axis2.transport.http.util.HTTPProxyConfigurationUtil.configure(HTTPProxyConfigurationUtil.java:154)
at org.apache.axis2.transport.http.AbstractHTTPSender.getHostConfiguration(AbstractHTTPSender.java:294)
at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:591)
at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:193)
at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:75)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:404)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:231)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:443)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:406)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:555)
at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:531)
at org.apache.axis2.rpc.client.RPCServiceClient.invokeBlocking(RPCServiceClient.java:102)
at me.project.server.WSClient.skosClassifier(WSClient.java:103)
at me.project.server.ServerProxyImpl.getFromRemoteServer(ServerProxyImpl.java:420)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:569)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:208)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:248)
at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

如果我部署在另一个应用程序服务器(如码头)上,我没有错误。tomcat 有什么问题?

这是调用 Web 服务的代码:

static String skosClassifier(String repository,String message) throws AxisFault {
    RPCServiceClient serviceClient = new RPCServiceClient();
    Options opt = serviceClient.getOptions();
    opt.setTo(targetEPR);
    QName opEcho = new QName("http://service.project.me","skosClassifier");
    BufferedReader console=new BufferedReader(new InputStreamReader(System.in));
    try{
        Object[] opEchoArgs=null;
        Class[] returnTypes=new Class[]{String.class};
        Object[] response=null;
        opEchoArgs=new Object[]{repository,message,false};
        response=serviceClient.invokeBlocking(opEcho, opEchoArgs, returnTypes);
        String returnValue = (String)response[0];
        return returnValue;
    } catch (Exception e){
        e.printStackTrace();
    }
    return "SERVER ERROR";
4

2 回答 2

1

我正在查看显示 NumberFormatException 的堆栈跟踪。

查看文件 HTTPProxyConfigurationUtil(我正在检查axis2-1.6.2),该行正在解析代理端口。下面是相关代码。

String port = System.getProperty(HTTP_PROXY_PORT);
        if(port != null) {
            proxyPort = Integer.parseInt(port);
        }

您是否为 HTTP_PROXY_PORT 设置了有效的整数值?您需要检查传递给 JVM 的参数。

于 2013-05-22T02:11:15.823 回答
0

请检查web.xml标题是否正确。通常错误是通过web.xml.

于 2013-05-23T06:48:34.393 回答