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 64CFDF9BA for ; Mon, 29 Apr 2013 05:54:25 +0000 (UTC) Received: (qmail 35055 invoked by uid 500); 29 Apr 2013 05:54:23 -0000 Delivered-To: apmail-axis-java-dev-archive@axis.apache.org Received: (qmail 34843 invoked by uid 500); 29 Apr 2013 05:54:19 -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 34451 invoked by uid 99); 29 Apr 2013 05:54:16 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 Apr 2013 05:54:16 +0000 Date: Mon, 29 Apr 2013 05:54:16 +0000 (UTC) From: "Kishanthan Thangarajah (JIRA)" To: java-dev@axis.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (AXIS2-5184) Code working with Axis 2 1.5.x throws exception with 1.6.1 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-5184?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13644291#comment-13644291 ] Kishanthan Thangarajah commented on AXIS2-5184: ----------------------------------------------- This is same as AXIS2-5501. The cause/reason and workaround is explained in AXIS2-5501 itself. If you want to use/pass configurationContext to the stub, you can either use ConfigurationContextFactory.createDefaultConfigurationContext() or ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, null). For the first approach, you have to initialize the transportSenders. But for second approach, no such thing is needed. > Code working with Axis 2 1.5.x throws exception with 1.6.1 > ---------------------------------------------------------- > > Key: AXIS2-5184 > URL: https://issues.apache.org/jira/browse/AXIS2-5184 > Project: Axis2 > Issue Type: Bug > Components: client-api > Affects Versions: 1.6.1 > Environment: Windows / Solaris > Reporter: Dmitriy > > The following code is working when using JRE 5 with Axis2 1.5.1 and 1.5.6: > public static void test() throws Exception { > ConfigurationContext ctx = ConfigurationContextFactory.createDefaultConfigurationContext(); > String svcAddrress = "http://localhost:8080/axis2/services/era_aas"; > Era_aasStub stub = new Era_aasStub(ctx,svcAddrress); > Era_aasStub.UserIdentityIn in = new Era_aasStub.UserIdentityIn(); > in.setCallerId("DMITRIY"); > // more fields are set here, all are Strings > Era_aasStub.UserProfile out = stub.loginUi(in); > } > When I switch to JRE 6 using Axis 1.6.1 the code throws the following exception: > 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) > at gov.nih.era.aas.client.auto.Era_aasStub.loginUi(Era_aasStub.java:498) > at AasServiceTest.test(AasServiceTest.java:93) > at AasServiceTest.main(AasServiceTest.java:53) > The workaround I have found is to change the code as following (do not pass context to the stub constructor): > public static void test() throws Exception { > ConfigurationContext ctx = ConfigurationContextFactory.createDefaultConfigurationContext(); > String svcAddrress = "http://localhost:8080/axis2/services/era_aas"; > Era_aasStub stub = new Era_aasStub(svcAddrress); // <-- this is the only change I had to make > Era_aasStub.UserIdentityIn in = new Era_aasStub.UserIdentityIn(); > in.setCallerId("DMITRIY"); > // more fields are set here, all are Strings > Era_aasStub.UserProfile out = stub.loginUi(in); > } > However, this solution requires multiple code changes and also causes problems when we do need to pass context to the stub. Please advise if there is a proper way to make the code work using ConfigurationContextFactory.createDefaultConfigurationContext(). Additional details: > No custom configuration - I am using standard binary distribution of Axis 2 version 1.6.1. The service code is generated from WSDL using ADB data binding. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators 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