使用Apache Axis2 Java RPCServiceClient加载时出现Null指针异常

时间:2016-04-04 14:54:40

标签: java apache axis2

我们正在尝试使用Apache Axis2框架访问RPC样式的Web服务。它在正常的负载条件下运行良好。但是我们可以在稍微增加的负载上看到随机空指针异常。下面是跟踪..

  

显示java.lang.NullPointerException           at org.apache.axis2.context.AbstractContext.needPropertyDifferences(AbstractContext.java:239)           at org.apache.axis2.context.AbstractContext.setProperty(AbstractContext.java:202)           at org.apache.axis2.transport.http.impl.httpclient3.HTTPSenderImpl.obtainHTTPHeaderInformation(HTTPSenderImpl.java:394)           at org.apache.axis2.transport.http.impl.httpclient3.HTTPSenderImpl.processResponse(HTTPSenderImpl.java:490)           at org.apache.axis2.transport.http.impl.httpclient3.HTTPSenderImpl.handleResponse(HTTPSenderImpl.java:311)           at org.apache.axis2.transport.http.impl.httpclient3.HTTPSenderImpl.sendViaPost(HTTPSenderImpl.java:213)           在org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:121)           在org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:403)           在org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:234)           在org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:431)           在org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:399)           在org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:225)           在org.apache.axis2.client.OperationClient.execute(OperationClient.java:150)

与Axis2和ESB相关的问题几乎没有。

http://wso2-oxygen-tank.10903.n7.nabble.com/ESB-Getting-random-NullPointerException-on-Operation-Client-during-Connector-Integration-Tests-td93294.html

但是有没有使用Axis2的纯Java客户端的解决方案?

我们的实施的代码片段在下面..

RPCServiceClient sender = new RPCServiceClient();
MessageContext reqMessageContext = new MessageContext();
OperationClient opClient = sender
                .createClient(ServiceClient.ANON_OUT_IN_OP);
        reqMessageContext.setEnvelope(buildRequestSoapEnvelope());
reqMessageContext.setProperty(HTTPConstants.HTTP_HEADERS,
                headers);
opClient.addMessageContext(reqMessageContext);
        opClient.execute(true);

        MessageContext responseMessageContx = opClient
                .getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE);

任何解决方案或提示都将受到赞赏..我们使用1.7.0版本的Axis2库

0 个答案:

没有答案