Return-Path: X-Original-To: apmail-axis-java-dev-archive@www.apache.org Delivered-To: apmail-axis-java-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8A8AE92DA for ; Fri, 21 Oct 2011 08:55:04 +0000 (UTC) Received: (qmail 58884 invoked by uid 500); 21 Oct 2011 08:55:03 -0000 Delivered-To: apmail-axis-java-dev-archive@axis.apache.org Received: (qmail 58581 invoked by uid 500); 21 Oct 2011 08:54:56 -0000 Mailing-List: contact java-dev-help@axis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-dev@axis.apache.org Delivered-To: mailing list java-dev@axis.apache.org Received: (qmail 58024 invoked by uid 99); 21 Oct 2011 08:54:53 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 21 Oct 2011 08:54:53 +0000 X-ASF-Spam-Status: No, hits=-2000.5 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 21 Oct 2011 08:54:51 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 37E94314453 for ; Fri, 21 Oct 2011 08:52:32 +0000 (UTC) Date: Fri, 21 Oct 2011 08:52:32 +0000 (UTC) From: "Tammo van Lessen (Commented) (JIRA)" To: java-dev@axis.apache.org Message-ID: <214932660.201.1319187152230.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (AXIS2-3219) NPE in LocalTransportReceiver.processMessage() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/AXIS2-3219?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13132521#comment-13132521 ] 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 ticket. 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. Thanks, Tammo > NPE in LocalTransportReceiver.processMessage() > ----------------------------------------------- > > Key: AXIS2-3219 > URL: https://issues.apache.org/jira/browse/AXIS2-3219 > 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(LocalTransportReceiver.java:58) > at org.apache.axis2.transport.local.LocalTransportSender.finalizeSendWithToAddress(LocalTransportSender.java:112) > at org.apache.axis2.transport.local.LocalTransportSender.invoke(LocalTransportSender.java:87) > at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:396) > at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:374) > at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:211) > at org.apache.axis2.client.OperationClient.execute(OperationClient.java:163) > at org.apache.ode.axis2.ExternalService$1$1.call(ExternalService.java:150) > at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269) > at java.util.concurrent.FutureTask.run(FutureTask.java:123) > at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650) > at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675) > at java.lang.Thread.run(Thread.java:595) > 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; > } > // REST OF CLASS NOT INCLUDED > } > 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: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org For additional commands, e-mail: java-dev-help@axis.apache.org