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 Naresh Bhatia <NB...@sapient.com> on 2002/04/17 03:03:24 UTC

NullPointerException

Hi,

I am new to Axis - just started today with the beta 1 release. I have
created a simple web-service using Java2WSDL followed by WSDL2Java.
Unfortunately, I am getting a NullPointerException when calling the web
service. Could someone please help me with how to debug the problem. Details
below:

The client makes a call to the web service as follows:

    Collection donuts = donutStore.getAllDonuts(false);

The call goes to the server without any problems. The server returns the
following response:

HTTP/1.0 200 OK
Date: Wed, 17 Apr 2002 00:47:44 GMT
Server: WebLogic WebLogic Server 6.1 SP2  12/18/2001 11:13:46 #154529 
Content-Length: 2042
Content-Type: text/xml; charset=utf-8
Set-Cookie:
JSESSIONID=88GwTpbTKV41McMxMGccGL64pe19gMli9FthNCcIAMj6LHPQoo1w!-1962651994!
-1062731514!7001!7002; path=/
Connection: Close

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 <SOAP-ENV:Body>
  <ns1:getAllDonutsResponse
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns1="urn:DonutStore">
   <getAllDonutsResult xsi:type="SOAP-ENC:Array"
SOAP-ENC:arrayType="xsd:anyType[2]"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
    <item xsi:type="ns1:DonutData">
     <description xsi:type="xsd:string">Nice spicy cinnamon
flavor</description>
     <donutId xsi:type="ns1:DonutId">
      <id xsi:type="xsd:long">102</id>
     </donutId>
     <donutName xsi:type="xsd:string">Cinnamon</donutName>
     <imageUrl
xsi:type="xsd:string">/DonutStore/images/donuts/Cinnamon.jpg</imageUrl>
     <price xsi:type="ns2:Money"
xmlns:ns2="http://util.framework.sapient.com">
      <precision xsi:type="xsd:int">2</precision>
      <roundingMode xsi:type="xsd:int">4</roundingMode>
      <bigDecimal xsi:type="xsd:decimal">0.99</bigDecimal>
     </price>
     <salePrice xsi:nil="true"/>
     <saleStartDate xsi:nil="true"/>
     <saleEndDate xsi:nil="true"/>
    </item>
    <item xsi:type="ns1:DonutData">
     <description xsi:type="xsd:string">No frills donut</description>
     <donutId xsi:type="ns1:DonutId">
      <id xsi:type="xsd:long">101</id>
     </donutId>
     <donutName xsi:type="xsd:string">Plain</donutName>
     <imageUrl
xsi:type="xsd:string">/DonutStore/images/donuts/Plain.jpg</imageUrl>
     <price xsi:type="ns3:Money"
xmlns:ns3="http://util.framework.sapient.com">
      <precision xsi:type="xsd:int">2</precision>
      <roundingMode xsi:type="xsd:int">4</roundingMode>
      <bigDecimal xsi:type="xsd:decimal">0.99</bigDecimal>
     </price>
     <salePrice xsi:nil="true"/>
     <saleStartDate xsi:nil="true"/>
     <saleEndDate xsi:nil="true"/>
    </item>
   </getAllDonutsResult>
  </ns1:getAllDonutsResponse>
 </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

The client gets a NullPointerException when processing the response. I have
turned on debug logging, but the only message in the log is the following
stack trace:

10   [main] ERROR org.apache.axis.client.Call  - Exception:
java.lang.NullPointerException
	at
org.apache.axis.encoding.ser.BeanDeserializer.onStartChild(Unknown Source)
	at
org.apache.axis.encoding.DeserializationContextImpl.startElement(Unknown
Source)
	at org.apache.axis.message.SAX2EventRecorder.replay(Unknown Source)
	at org.apache.axis.message.MessageElement.publishToHandler(Unknown
Source)
	at org.apache.axis.message.RPCElement.deserialize(Unknown Source)
	at org.apache.axis.message.RPCElement.getParams(Unknown Source)
	at org.apache.axis.client.Call.invoke(Unknown Source)
	at org.apache.axis.client.Call.invoke(Unknown Source)
	at org.apache.axis.client.Call.invoke(Unknown Source)
	at
com.sapient.donutstore.donut.DonutStoreSoapBindingStub.getAllDonuts(DonutSto
reSoapBindingStub.java:249)
	at
com.sapient.donutstore.donut.WebServiceTest.main(WebServiceTest.java:17)

Please help.

Naresh Bhatia