axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tammo van Lessen (Commented) (JIRA)" <>
Subject [jira] [Commented] (AXIS2-3219) NPE in LocalTransportReceiver.processMessage()
Date Fri, 21 Oct 2011 08:52:32 GMT


Tammo van Lessen commented on AXIS2-3219:

This issue is still not fixed and is causing NPEs in my real life, so please re-open this

Here is what happens:

I'm calling a service via the local transport. The message is passed to LocalTransportSender,
which eventually creates and instance of LocalTransportReceiver in finalizeSendWithToAddress(...).
It passes itself (i.e. an instance of LocalTransportSender) to the constructor, which sets
its confContext field to the static CONFIG_CONTEXT field, which is always null. Thus, localTransportReceiver.processMessage
is destined to throw a NPE.

The only workaround is to manually set the CONFIG_CONTEXT somewhere before using the local
transport. I'm really wondering how the test case can run without exposing this NPE.

The fix would be easy IMO by passing the configuration context that can be get from the msgContext
directly to the constructor of LocalTransportReceiver. The LocalTransportReceiver(LocalTransportSender
sender) constructor is currently useless IMO.

The nicer fix would be probably to add a field for the config context in the LocalTransportSender
and set it in its init(...) method. Then, the LocalTransportReceiver(LocalTransportSender
sender) could use the config context hold in the sender.

> NPE in LocalTransportReceiver.processMessage() 
> -----------------------------------------------
>                 Key: AXIS2-3219
>                 URL:
>             Project: Axis2
>          Issue Type: Bug
>          Components: transports
>            Reporter: Alex Boisvert
>            Assignee: David Illsley
> I tried to invoke a service through the local transport and got:
> java.lang.NullPointerException
>         at org.apache.axis2.transport.local.LocalTransportReceiver.processMessage(
>         at org.apache.axis2.transport.local.LocalTransportSender.finalizeSendWithToAddress(
>         at org.apache.axis2.transport.local.LocalTransportSender.invoke(
>         at org.apache.axis2.engine.AxisEngine.send(
>         at org.apache.axis2.description.OutInAxisOperationClient.send(
>         at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(
>         at org.apache.axis2.client.OperationClient.execute(
>         at org.apache.ode.axis2.ExternalService$1$
>         at java.util.concurrent.FutureTask$Sync.innerRun(
>         at
>         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(
>         at java.util.concurrent.ThreadPoolExecutor$
>         at
> Looking at the code (trunk r577941),
> public class LocalTransportReceiver {
>     public static ConfigurationContext CONFIG_CONTEXT;
>     private ConfigurationContext confContext;
>     private LocalTransportSender sender;
>     public LocalTransportReceiver(ConfigurationContext configContext) {
>         confContext = configContext;
>     }
>     public LocalTransportReceiver(LocalTransportSender sender) {
>         this(CONFIG_CONTEXT);
>         this.sender = sender;
>     }
> }
> It doesn't look like CONFIG_CONTEXT is being initalized, and I would expect the current
ConfigurationContext to be supplied by the LocalTransportSender.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message