users@jax-rpc.java.net

Re: Complex return values and a NullPointerException

From: Doug Kohlert <Doug.Kohlert_at_Sun.COM>
Date: Mon, 12 Jul 2004 10:10:32 -0700

Gabe,
Are you sending a non-null value; What is the method signature on the
stub that you are trying to call and how are you calling it?
What is the corresponding signature on your service endpoint interface?

thanks

Gabriel Bauman wrote:

>Hello,
>
>When calling a method published by JAX-RPC that returns a complex type,
>I am receiving the following error on the client:
>
>faultcode: env:Client
>faultstring: JAXRPC.TIE.01: caught exception while handling request: deserialization error: java.lang.NullPointerException
>
>In my server logs, the exception appears deep in JAX-RPC generated classes:
>
>[16:20:27.876]JAXRPC.JAXRPCSERVLET.19: got request for endpoint: LeetService
>[16:20:27.876]JAXRPC.JAXRPCSERVLET.21: invoking implementor: com.sun.xml.rpc.server.http.Implementor_at_9ba045
>[16:20:27.879]deserialization error: java.lang.NullPointerException
>[16:20:27.879] at com.sun.xml.rpc.encoding.ObjectSerializerBase.deserialize(ObjectSerializerBase.java:214)
>[16:20:27.879] at com.sun.xml.rpc.encoding.ReferenceableSerializerImpl.deserialize(ReferenceableSerializerImpl.java:134)
>[16:20:27.879] at com.bravenet.hosting.provisioner.ws.LeetService__LeetService__Tie.deserialize_findAccount(LeetService__LeetService__Tie.java:158)
>...
>[16:20:27.879]CAUSE:
>[16:20:27.879]
>[16:20:27.879]java.lang.NullPointerException
>[16:20:27.879] at com.bravenet.hosting.provisioner.ws.LeetService_findAccount_RequestStruct__LeetService__SOAPSerializer.doDeserialize(LeetService_findAccount_ RequestStruct__LeetService__SOAPSerializer.java:42)
>[16:20:27.879] at com.sun.xml.rpc.encoding.ObjectSerializerBase.deserialize(ObjectSerializerBase.java:167)
>...
>
>The exception is thrown before the service implementation class's
>matching method is called, so I cannot catch it anywhere in my code on
>the server. I am using the JAX-RPC that came with the JWSDP 1.4.
>
>I have attached a WSDL file which contains 2 operations. findAccount
>(long) always fails as I have described. leet() always succeeds. It
>seems that whenever I call a method that returns a complex type, the
>service fails.
>
>Can anyone offer any insight as to what is happening here?
>
>
>
>------------------------------------------------------------------------
>
><?xml version="1.0" encoding="utf-8"?>
><definitions name="LeetService" targetNamespace="urn:com.bravenet.hosting.provisioner.ws/wsdl/LeetService" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/">
> <types>
> <schema targetNamespace="urn:com.bravenet.hosting.provisioner.ws/types/LeetService" xmlns="http://www.w3.org/2001/XMLSchema">
> <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
> <complexType name="AccountValue">
> <sequence>
> <element name="actionContext" type="string"/>
> <element name="bandwidthQuota" type="int"/>
> <element name="bundle" type="int"/>
> <element name="diskSpaceQuota" type="int"/>
> <element name="fileCountQuota" type="int"/>
> <element name="fileSizeQuota" type="int"/>
> <element name="masterVersionId" type="long"/>
> <element name="primaryKey" type="long"/>
> <element name="status" type="byte"/>
> <element name="storageRoot" type="string"/>
> <element name="timestamp" type="dateTime"/>
> <element name="unixGid" type="int"/>
> <element name="unixUid" type="int"/>
> <element name="usernum" type="long"/></sequence></complexType>
> <complexType name="ProvisionerException">
> <sequence>
> <element name="message" type="string" nillable="true"/></sequence></complexType></schema></types>
> <message name="LeetService_findAccount">
> <part name="long_1" type="xsd:long"/></message>
> <message name="LeetService_findAccountResponse">
> <part name="result" type="ns2:AccountValue"/></message>
> <message name="ProvisionerException">
> <part name="ProvisionerException" type="ns2:ProvisionerException"/></message>
> <message name="LeetService_leet"/>
> <message name="LeetService_leetResponse">
> <part name="result" type="xsd:string"/></message>
> <portType name="LeetService">
> <operation name="findAccount" parameterOrder="long_1">
> <input message="tns:LeetService_findAccount"/>
> <output message="tns:LeetService_findAccountResponse"/>
> <fault name="ProvisionerException" message="tns:ProvisionerException"/></operation>
> <operation name="leet" parameterOrder="">
> <input message="tns:LeetService_leet"/>
> <output message="tns:LeetService_leetResponse"/></operation></portType>
> <binding name="LeetServiceBinding" type="tns:LeetService">
> <operation name="findAccount">
> <input>
> <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded" namespace="urn:com.bravenet.hosting.provisioner.ws/wsdl/LeetService"/></input>
> <output>
> <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded" namespace="urn:com.bravenet.hosting.provisioner.ws/wsdl/LeetService"/></output>
> <fault name="ProvisionerException">
> <soap:fault name="ProvisionerException" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded" namespace="urn:com.bravenet.hosting.provisioner.ws/wsdl/LeetService"/></fault>
> <soap:operation soapAction=""/></operation>
> <operation name="leet">
> <input>
> <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded" namespace="urn:com.bravenet.hosting.provisioner.ws/wsdl/LeetService"/></input>
> <output>
> <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded" namespace="urn:com.bravenet.hosting.provisioner.ws/wsdl/LeetService"/></output>
> <soap:operation soapAction=""/></operation>
> <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc"/></binding>
> <service name="LeetService">
> <port name="LeetServicePort" binding="tns:LeetServiceBinding">
> <soap:address location="http://jovanovski.vc.bravenet.com:8080/hosting/LeetService"/></port></service></definitions>
>
>
>------------------------------------------------------------------------
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe_at_jax-rpc.dev.java.net
>For additional commands, e-mail: users-help_at_jax-rpc.dev.java.net
>
>

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Doug Kohlert
Sun Microsystems, Inc.            
doug.kohlert_at_sun.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jax-rpc.dev.java.net
For additional commands, e-mail: users-help_at_jax-rpc.dev.java.net