Discussion:
Axis 1.6.2 - NPE when invoking CommonsHTTPTransportSender
Kusuma Atmakuri
2015-01-19 14:56:21 UTC
Permalink
Hi,

While trying to upgrade to Axis 1.6.2, I ran into an issue - NPE is thrown
when invoking CommonsHTTPTransportSender. Below is the stack trace.

*Exception in thread "main" java.lang.NullPointerException*
* at
org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:172)*
* 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)*

Tried creating the context in different ways but nothing had helped.
When googled, found a couple of threads on the same issue but that was to
do with the older versions of Axis.
When checked out the source, found the following in send() method of
org.apache.axis2.engine.AxisEngine. Shouldn't the sender be initialized
before invoked? Or *transportOut *should have returned an initialized
sender, right?

*TransportOutDescription transportOut = msgContext.getTransportOut();*
*if (transportOut == null) {*
* throw new AxisFault("Transport out has not been set");*
*}*
*TransportSender sender = transportOut.getSender();*
*// This boolean property only used in client side fireAndForget invocation*
*//It will set a property into message context and if some one has set the*
*//property then transport sender will invoke in a diffrent thread*
*if (Utils.isClientThreadNonBlockingPropertySet(msgContext)) {*
* msgContext.getConfigurationContext().getThreadPool().execute(*
* new TransportNonBlockingInvocationWorker(msgContext, sender));*
*} else {*
* sender.invoke(msgContext);*
*}*

Can someone please throw some light on this? Am I missing something here?
What should be the work around?
--
Thank you!
-Kusum
Loading...