You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Vincent Giguere <vi...@gmail.com> on 2007/07/18 21:33:31 UTC

NullPointerException when processing answer

Hi, 

I am deploying a web service through Axis2 embedded within a web
application, with the implementing bean being provided through Spring.

The implementing bean is being called and the call goes through. However, I
am experiencing a NullPointerException without much information when Axis2
processes the response back.

As an alternative, I have removed the Spring Integration and directly
provided a serviceClass parameter to Axis2. This yields to the same error.

In order for you to follow the included information below, The call being
made is:
GetAnonymousLocationResponse 
Location.getAnonymousLocation(GetAnonymousLocationRequest arequest)


I am using axis2 1.2. Here are my dependencies (excertp from maven pom.xml)
<dependency>
		    <groupId>org.apache.ws.commons.axiom</groupId>
		    <artifactId>axiom-api</artifactId>
		    <version>1.2.4</version>
		</dependency>
				<dependency>
			<groupId>org.apache.axis2</groupId>
			<artifactId>axis2</artifactId>
			<version>1.2</version>
		</dependency>		
		<dependency>
		    <groupId>org.apache.axis2</groupId>
		    <artifactId>axis2-adb</artifactId>
		    <version>1.2</version>
		</dependency>
		<dependency>
		    <groupId>org.apache.axis2</groupId>
		    <artifactId>axis2-kernel</artifactId>
		    <version>1.2</version>
		</dependency>
		<dependency>
		    <groupId>org.apache.axis2</groupId>
		    <artifactId>axis2-xmlbeans</artifactId>
		    <version>1.2</version>
		</dependency>
		<dependency>
		    <groupId>org.apache.axis2</groupId>
		    <artifactId>axis2-spring</artifactId>
		    <version>1.2</version>
		</dependency>
		<dependency>
		    <groupId>org.apache.axis2</groupId>
		    <artifactId>axis2-jibx</artifactId>
		    <version>1.2</version>
		</dependency>	


The services.xml is: 

<service name="LocationService">
	<description>Please Type your service description here</description>
	<messageReceivers>
		<messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only"
class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver" />
		<messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out"
class="org.apache.axis2.rpc.receivers.RPCMessageReceiver" />
	</messageReceivers>
	<parameter name="ServiceObjectSupplier"
locked="false">org.apache.axis2.extensions.spring.receivers.SpringServletContextObjectSupplier</parameter>
	<parameter name="SpringBeanName"
locked="false">locationServiceImpl</parameter>
	<!-- 	<parameter name="ServiceClass"
locked="false">com.confidential.emx.adapter.ibsp.service.Location</parameter>
-->
</service>


This is the WSDL (NOT generated on the fly because of the Spring
integration)
 <wsdl:definitions
xmlns:ns="http://service.ibsp.adapter.emx.confidential.com"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:xsd="http://service.ibsp.adapter.emx.confidential.com/xsd"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
targetNamespace="http://service.ibsp.adapter.emx.confidential.com"><wsdl:types><xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:ax27="http://responses.service.ibsp.adapter.emx.confidential.com/xsd"
xmlns:ax28="http://service.ibsp.adapter.emx.confidential.com/xsd"
attributeFormDefault="qualified" elementFormDefault="qualified"
targetNamespace="http://responses.service.ibsp.adapter.emx.confidential.com/xsd">
<xs:import namespace="http://service.ibsp.adapter.emx.confidential.com/xsd"
/>
<xs:element name="GetAnonymousLocationResponse"
type="ax27:GetAnonymousLocationResponse" />
<xs:complexType name="GetAnonymousLocationResponse">
<xs:sequence>
<xs:element name="authRedirectURL" nillable="true" type="xs:string" />
<xs:element name="result" nillable="true" type="ax28:OperationResult" />
</xs:sequence>
</xs:complexType>
</xs:schema><xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:ax26="http://requests.service.ibsp.adapter.emx.confidential.com/xsd"
attributeFormDefault="qualified" elementFormDefault="qualified"
targetNamespace="http://requests.service.ibsp.adapter.emx.confidential.com/xsd">
<xs:element name="GetAnonymousLocationRequest"
type="ax26:GetAnonymousLocationRequest" />
<xs:complexType name="GetAnonymousLocationRequest">
<xs:sequence>
<xs:element name="acceptableAccuracy" type="xs:int" />
<xs:element name="correlationId" type="xs:int" />
<xs:element name="maximumAge" type="xs:int" />
<xs:element name="notificationURI" nillable="true" type="xs:string" />
<xs:element name="requestedAccuracy" type="xs:int" />
<xs:element name="responseTime" type="xs:int" />
<xs:element name="serviceRedirectURL" nillable="true" type="xs:string" />
<xs:element name="sessionId" type="xs:int" />
</xs:sequence>
</xs:complexType>
</xs:schema><xs:schema
xmlns:ns1="http://responses.service.ibsp.adapter.emx.confidential.com/xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:ns0="http://requests.service.ibsp.adapter.emx.confidential.com/xsd"
attributeFormDefault="qualified" elementFormDefault="qualified"
targetNamespace="http://service.ibsp.adapter.emx.confidential.com/xsd">
<xs:element name="getAnonymousLocation">
<xs:complexType>
<xs:sequence>
<xs:element name="req" nillable="true"
type="ns0:GetAnonymousLocationRequest" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="getAnonymousLocationResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="return" nillable="true"
type="ns1:GetAnonymousLocationResponse" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="OperationResult" type="xsd:OperationResult" />
<xs:complexType name="OperationResult">
<xs:sequence>
<xs:element name="reasonCode" type="xs:int" />
<xs:element name="responseCode" nillable="true"
type="xsd:OperationResult$ResponseCode" />
<xs:element name="resultText" nillable="true" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:element name="OperationResult$ResponseCode"
type="xsd:OperationResult$ResponseCode" />
<xs:complexType name="OperationResult$ResponseCode">
<xs:complexContent>
<xs:extension base="xs:Enum">
<xs:sequence>
<xs:element name="BAD_OPERATION" nillable="true"
type="xsd:OperationResult$ResponseCode" />
<xs:element name="INTERNAL_SERVER_ERROR" nillable="true"
type="xsd:OperationResult$ResponseCode" />
<xs:element name="INVALID_CREDENTIAL" nillable="true"
type="xsd:OperationResult$ResponseCode" />
<xs:element name="INVALID_LOGIN" nillable="true"
type="xsd:OperationResult$ResponseCode" />
<xs:element name="LOCATION_NOT_FOUND" nillable="true"
type="xsd:OperationResult$ResponseCode" />
<xs:element name="MAX_THROTTLING_EXCEEDED" nillable="true"
type="xsd:OperationResult$ResponseCode" />
<xs:element name="MAX_THROTTLING_RATE_EXCEEDED" nillable="true"
type="xsd:OperationResult$ResponseCode" />
<xs:element name="NOT_AUTHORIZE" nillable="true"
type="xsd:OperationResult$ResponseCode" />
<xs:element name="SUCCESS" nillable="true"
type="xsd:OperationResult$ResponseCode" />
<xs:element name="USER_LOCK" nillable="true"
type="xsd:OperationResult$ResponseCode" />
<xs:element name="USER_UNKNOWN" nillable="true"
type="xsd:OperationResult$ResponseCode" />
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:schema></wsdl:types><wsdl:message
name="getAnonymousLocationMessage"><wsdl:part name="part1"
element="xsd:getAnonymousLocation" /></wsdl:message><wsdl:message
name="getAnonymousLocationResponseMessage"><wsdl:part name="part1"
element="xsd:getAnonymousLocationResponse" /></wsdl:message><wsdl:portType
name="LocationServicePortType"><wsdl:operation
name="getAnonymousLocation"><wsdl:input
xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
wsaw:Action="urn:getAnonymousLocation"
message="ns:getAnonymousLocationMessage" /><wsdl:output
xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
message="ns:getAnonymousLocationResponseMessage"
wsaw:Action="urn:getAnonymousLocation"
/></wsdl:operation></wsdl:portType><wsdl:binding
name="LocationServiceSOAP11Binding"
type="ns:LocationServicePortType"><soap:binding
transport="http://schemas.xmlsoap.org/soap/http" style="document"
/><wsdl:operation name="getAnonymousLocation"><soap:operation
soapAction="urn:getAnonymousLocation" style="document"
/><wsdl:input><soap:body use="literal"
/></wsdl:input><wsdl:output><soap:body use="literal"
/></wsdl:output></wsdl:operation></wsdl:binding><wsdl:binding
name="LocationServiceSOAP12Binding"
type="ns:LocationServicePortType"><soap12:binding
transport="http://schemas.xmlsoap.org/soap/http" style="document"
/><wsdl:operation name="getAnonymousLocation"><soap12:operation
soapAction="urn:getAnonymousLocation" style="document"
/><wsdl:input><soap12:body use="literal"
/></wsdl:input><wsdl:output><soap12:body use="literal"
/></wsdl:output></wsdl:operation></wsdl:binding><wsdl:service
name="LocationService"><wsdl:port name="LocationServiceSOAP11port"
binding="ns:LocationServiceSOAP11Binding"><soap:address
location="http://localhost:8080/axis2/services/LocationService"
/></wsdl:port><wsdl:port name="LocationServiceSOAP12port"
binding="ns:LocationServiceSOAP12Binding"><soap12:address
location="http://localhost:8080/axis2/services/LocationService"
/></wsdl:port></wsdl:service></wsdl:definitions>



Here is my stack trace

- Exception occurred while trying to invoke service method
getAnonymousLocation
org.apache.axiom.om.OMException: java.lang.NullPointerException
        at
org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:211)
        at
org.apache.axiom.om.impl.llom.OMNodeImpl.build(OMNodeImpl.java:315)
        at
org.apache.axiom.om.impl.llom.OMElementImpl.build(OMElementImpl.java:608)
        at
org.apache.axiom.om.impl.llom.OMElementImpl.detach(OMElementImpl.java:577)
        at
org.apache.axiom.om.impl.llom.OMNodeImpl.setParent(OMNodeImpl.java:114)
        at
org.apache.axiom.om.impl.llom.OMElementImpl.addChild(OMElementImpl.java:236)
        at
org.apache.axiom.om.impl.llom.OMElementImpl.addChild(OMElementImpl.java:192)
        at
org.apache.axis2.rpc.receivers.RPCUtil.processResponse(RPCUtil.java:105)
        at
org.apache.axis2.rpc.receivers.RPCUtil.processResponse(RPCUtil.java:251)
        at
org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.java:134)
        at
org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.receive(AbstractInOutSyncMessageReceiver.java:39)
        at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:144)
        at
org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:279)
        at
org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:116)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
        at
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
        at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1098)
        at
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:265)
        at
org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107)
        at
org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72)
        at
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
        at
org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:110)
        at
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
        at
org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:229)
        at
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
        at
org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:286)
        at
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
        at
org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:149)
        at
org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)
        at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1089)
        at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:365)
        at
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
        at
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
        at
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712)
        at
org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
        at
org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:211)
        at
org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
        at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
        at org.mortbay.jetty.Server.handle(Server.java:295)
        at
org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:503)
        at
org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:841)
        at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:721)
        at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:204)
        at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:379)
        at
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:361)
        at
org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:442)
Caused by: java.lang.NullPointerException
        at
org.apache.axis2.databinding.utils.BeanUtil.getPullParser(BeanUtil.java:153)
        at
org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl.processProperties(ADBXMLStreamReaderImpl.java:926)
        at
org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl.next(ADBXMLStreamReaderImpl.java:799)
        at
org.apache.axis2.databinding.utils.reader.WrappingXMLStreamReader.next(WrappingXMLStreamReader.java:45)
        at
org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl.next(ADBXMLStreamReaderImpl.java:802)
        at
org.apache.axis2.databinding.utils.reader.WrappingXMLStreamReader.next(WrappingXMLStreamReader.java:45)
        at
org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl.next(ADBXMLStreamReaderImpl.java:802)
        at
org.apache.axis2.databinding.utils.reader.WrappingXMLStreamReader.next(WrappingXMLStreamReader.java:45)
        at
org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl.next(ADBXMLStreamReaderImpl.java:802)
        at org.apache.axis2.util.StreamWrapper.next(StreamWrapper.java:68)
        at
org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:125)

Thanks in advance for any help.
Regards, 

Vincent Giguère
vincent.giguere@gmail.com
-- 
View this message in context: http://www.nabble.com/NullPointerException-when-processing-answer-tf4105431.html#a11675536
Sent from the Axis - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: NullPointerException when processing answer

Posted by Deepal Jayasinghe <de...@opensource.lk>.
Hi Vincent ,
Please create a JIRA and attach whatever necessary to re-create the
issue. In the meantime if possible please try with Axis2 1.3 RC1

Thanks
Deepal
> Hi, 
>
> I am deploying a web service through Axis2 embedded within a web
> application, with the implementing bean being provided through Spring.
>
> The implementing bean is being called and the call goes through. However, I
> am experiencing a NullPointerException without much information when Axis2
> processes the response back.
>
> As an alternative, I have removed the Spring Integration and directly
> provided a serviceClass parameter to Axis2. This yields to the same error.
>
> In order for you to follow the included information below, The call being
> made is:
> GetAnonymousLocationResponse 
> Location.getAnonymousLocation(GetAnonymousLocationRequest arequest)
>
>
>
>   




---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org