[ http://issues.apache.org/jira/browse/AXIS2-679?page=comments#action_12378303 ]
Ali Sadik Kumlali commented on AXIS2-679: ----------------------------------------- After some more work, I've come to cancel my both assertions which say "NPE" and "there is no WSA and WSSE headers". I've noticed that; - I called stub of serviceA, not serviceB - I didn't add InflowSecurity and OutflowSecurity parameters to the axis2.xml of axis2.war. By the way, I've just seen a strange situation. After I start the Tomcat which my serviceA.aar is deployed I list the services on it by calling http://localhost:8080/axis2/services/listServices. Only services I see there belong to serviceA.aar. But, after the first call to serviceB's stub within a class found in serviceA, serviceB is also listed in the page. The page says "Service Description : null" for the service. When clicked on it, it says "Unable to generate WSDL for this service". > Calling a service from within another service causes NPE > -------------------------------------------------------- > > Key: AXIS2-679 > URL: http://issues.apache.org/jira/browse/AXIS2-679 > Project: Apache Axis 2.0 (Axis2) > Type: Bug > Components: core > Versions: 1.0 > Environment: WinXP Pro, JDK 1.4, Tomcat 5.5 > Reporter: Ali Sadik Kumlali > Assignee: Deepal Jayasinghe > > Here is my scenario: > 1) I have serviceA.wsdl and serviceB.wsdl. > 2) I generate skeletons and stubs with WSDL2Java > 3) I have serviceA.aar which has serviceB.wsdl's stub > 4) When I call serviceB's stub from a class found in serviceA.aar I get the > following error: > ---------------------------------------------------------------- > java.lang.NullPointerException > at > org.apache.axis2.context.ServiceGroupContext.getServiceContext(ServiceGroupContext.java:59) > at org.apache.axis2.client.ServiceClient.<init>(ServiceClient.java:101) > at > com.mycompany.service.test.account.AccountServicesStub.<init>(AccountServicesStub.java:79) > ---------------------------------------------------------------- > I founded that "unassinged parent" caused the NPE. If the service is already > registered in axisConfig it doesn't enter in the code that assings a parent > to the service. Also, it doesn't uses the parent of the registered service. > The code causes NPE is here: > ---------------------------------------------------------------- > // org.apache.axis2.client.ServiceClient > public ServiceClient(ConfigurationContext configContext, > AxisService axisService) throws AxisFault { > ... > // If the service is already registered, it doesn't enter > // here so there will be no parent. > if (this.axisConfig.getService(this.axisService.getName()) == null) { > this.axisConfig.addService(this.axisService); > } > ServiceGroupContext sgc = new ServiceGroupContext(this.configContext, > (AxisServiceGroup) this.axisService.getParent()); > this.serviceContext = sgc.getServiceContext(this.axisService); > } > ---------------------------------------------------------------- > I made the following change and it worked: > ---------------------------------------------------------------- > // org.apache.axis2.client.ServiceClient > public ServiceClient(ConfigurationContext configContext, > AxisService axisService) throws AxisFault { > ... > AxisService service = null; > AxisService registeredService = > this.axisConfig.getService(this.axisService.getName()); > if (registeredService != null) { > service = registeredService; > } else { > this.axisConfig.addService(this.axisService); > service = this.axisService; > } > > ServiceGroupContext sgc = new ServiceGroupContext(this.configContext, > (AxisServiceGroup) service.getParent()); > this.serviceContext = sgc.getServiceContext(service); > } > ---------------------------------------------------------------- > But this time, there was no addressing and security headers in the soap > message. Then I tried to manually engage the modules as following: > ---------------------------------------------------------------- > stubB._getServiceClient().engageModule(new QName("addressing")); > stubB._getServiceClient().engageModule(new QName("rampart")); > ---------------------------------------------------------------- > It didn't work either. > P.S.: I tried both 1.0 RC5 and 1.0 releases. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
