users@jax-ws.java.net

Re: NPE when using jax-ws generated client resolved

From: Jitendra Kotamraju <Jitendra.Kotamraju_at_Sun.COM>
Date: Tue, 13 Jun 2006 18:12:12 -0700

Dan Stieglitz wrote:

> Chalk this one up to programmer's hubris ("it's not in my code")...
>
> Apparently I had configured a handler to intercept the message and
> pull the header, which, when non-existent, results in the NPE being
> sent back.
>
> Is there any way to stuff a full stack trace in a SOAP fault, to make
> the debugging process a bit less painless?
>
> Dan

Dan,

You are right. This is definitely in the TODOs for rearch branch.

Jitu

>
> On Jun 2, 2006, at 2:48 PM, Dan Stieglitz wrote:
>
>> Excellent suggestion... for posterity I'll say a freely available
>> utility you can use to achieve this is Apache's TcpTunnelGui which
>> comes with their soap implementation. You need only download the
>> distro and go to the lib directory, and then type:
>>
>> java -cp soap.jar org.apache.soap.util.net.TcpTunnelGui 8081
>> localhost 8080
>>
>> So, in fact, we do have traffic between the client and server. What
>> had confused me was that there was no log on the server to indicate
>> anything had been called. It seems as though the SOAP message being
>> sent from the client to the server is identical to the one generated
>> by Oxygen, except for a missing <soapenv:Header/> node.
>>
>> Oxygen generates an empty one but the JAX-WS generated code does
>> not, seeming resulting in a null pointer coming back. The web
>> service is certainly never invoked on the server.
>>
>> So-- how can one force the JAX-WS code to generate a SOAP header,
>> even an empty one? Can this be done without a header chain?
>>
>> Dan
>>
>> On Jun 2, 2006, at 12:44 PM, kathy walsh wrote:
>>
>>> Have you verified that no traffic goes over the wire to the server-
>>> ie using some type of HTTP monitor?
>>> What this error looks like is that a message does get sent to the
>>> server, a return message is received
>>> and the client while decoding the message throws an NPE.
>>>
>>> My suggestions:
>>>
>>> Verify if traffic goes to the server or not?
>>>
>>> If traffic does pass between the client and server, capture message
>>> sent and message received.
>>>
>>> That should tell you more about what is going wrong.
>>> Kathy
>>>
>>> Dan Stieglitz wrote:
>>>
>>>> Hi,
>>>>
>>>> I'm building an app using Netbeans 5, the latest jax-ws from cvs
>>>> (downloaded yesterday and imported as a netbeans library), and
>>>> SJSAS 8.1 PE (bundled with Netbeans). I've installed the JWSDP
>>>> 2.0 using the installer on both the IDE and the app server.
>>>>
>>>> I've successfully deployed a web service, and can talk to it using
>>>> an Oxygen XML SOAP client, generated from the WSDL that was
>>>> deployed. When I try to generate a JAX-WS client using the
>>>> recommended procedure (wsimport pointing to the WSDL), the code
>>>> generated throws the following error when run (see below).
>>>>
>>>> I've debugged it through to the JAX-WS code, and it seems like
>>>> the client never gets to the server but catches this internally.
>>>>
>>>> I've spent a number of hours trying to figure out what's going
>>>> on... any ideas?
>>>>
>>>> Dan
>>>>
>>>> Caught exception: java.lang.NullPointerException
>>>> javax.xml.ws.soap.SOAPFaultException: java.lang.NullPointerException
>>>> at
>>>> com.sun.xml.ws.encoding.soap.ClientEncoderDecoder.toMessageInfo
>>>> (ClientEncoderDecoder.java:84)
>>>> at
>>>> com.sun.xml.ws.encoding.soap.client.SOAPXMLDecoder.toMessageInfo
>>>> (SOAPXMLDecoder.java:209)
>>>> at
>>>> com.sun.xml.ws.protocol.soap.client.SOAPMessageDispatcher.receive
>>>> (SOAPMessageDispatcher.java:538)
>>>> at
>>>> com.sun.xml.ws.protocol.soap.client.SOAPMessageDispatcher.doSend
>>>> (SOAPMessageDispatcher.java:258)
>>>> at
>>>> com.sun.xml.ws.protocol.soap.client.SOAPMessageDispatcher.send
>>>> (SOAPMessageDispatcher.java:137)
>>>> at
>>>> com.sun.xml.ws.protocol.soap.client.SOAPMessageDispatcher.receive
>>>> (SOAPMessageDispatcher.java:538)
>>>> at
>>>> com.sun.xml.ws.protocol.soap.client.SOAPMessageDispatcher.doSend
>>>> (SOAPMessageDispatcher.java:258)
>>>> at
>>>> com.sun.xml.ws.protocol.soap.client.SOAPMessageDispatcher.send
>>>> (SOAPMessageDispatcher.java:137)
>>>> at
>>>> com.sun.xml.ws.encoding.soap.internal.DelegateBase.send
>>>> (DelegateBase.java:84)
>>>> at
>>>> com.sun.xml.ws.client.EndpointIFInvocationHandler.implementSEIMethod
>>>> (EndpointIFInvocationHandler.java:172)
>>>> at
>>>> com.sun.xml.ws.client.EndpointIFInvocationHandler.invoke
>>>> (EndpointIFInvocationHandler.java:106)
>>>> at $Proxy18.login(Unknown Source)
>>>> at
>>>> com.sun.xml.ws.encoding.soap.internal.DelegateBase.send
>>>> (DelegateBase.java:84)
>>>> at
>>>> com.sun.xml.ws.client.EndpointIFInvocationHandler.implementSEIMethod
>>>> (EndpointIFInvocationHandler.java:172)
>>>> at
>>>> com.sun.xml.ws.client.EndpointIFInvocationHandler.invoke
>>>> (EndpointIFInvocationHandler.java:106)
>>>> at $Proxy18.login(Unknown Source)
>>>> at com.mlb.val.test.WebServiceTest.testWebService
>>>> (WebServiceTest.java:117)
>>>> at com.mlb.val.test.WebServiceTest.testWebService
>>>> (WebServiceTest.java:117)
>>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>>>> Method)
>>>> at sun.reflect.NativeMethodAccessorImpl.invoke
>>>> (NativeMethodAccessorImpl.java:39)
>>>> at sun.reflect.DelegatingMethodAccessorImpl.invoke
>>>> (DelegatingMethodAccessorImpl.java:25)
>>>> at java.lang.reflect.Method.invoke(Method.java:585)
>>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>>>> Method)
>>>> at sun.reflect.NativeMethodAccessorImpl.invoke
>>>> (NativeMethodAccessorImpl.java:39)
>>>> at sun.reflect.DelegatingMethodAccessorImpl.invoke
>>>> (DelegatingMethodAccessorImpl.java:25)
>>>> at java.lang.reflect.Method.invoke(Method.java:585)
>>>>
>>>> ...etc.
>>>>
>>>> -------------------------------------------------------------------- -
>>>> To unsubscribe, e-mail: users-unsubscribe_at_jax-ws.dev.java.net
>>>> For additional commands, e-mail: users-help_at_jax-ws.dev.java.net
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe_at_jax-ws.dev.java.net
>>> For additional commands, e-mail: users-help_at_jax-ws.dev.java.net
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_jax-ws.dev.java.net
>> For additional commands, e-mail: users-help_at_jax-ws.dev.java.net
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jax-ws.dev.java.net
> For additional commands, e-mail: users-help_at_jax-ws.dev.java.net
>