axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From D <textn...@gmail.com>
Subject Re: [Axis2] Generated client stub causes Null Pointer Exception in UTF8OutputStreamWriter.write
Date Fri, 23 Mar 2007 14:18:25 GMT
Apologies, when I put the fix in ALL my schema files, the issue was resolved.

Many Thanks,
Darren

On 22/03/07, D <textnode@gmail.com> wrote:
> Hi Davanum,
>
> Once registered with jira, I searched and found what looks (to my untrained
> eye) like the same issue, already logged:
>
> AXIS2-1964 Null Pointer Exception in Service STUB class at
> _operationClient.execute(true); line for AXIS2 1.1.1
>
> Best Regards,
> Darren
>
> P.S. Recommendation in the last comment: adding
> elementFormDefault="qualified" did not fix the issue in my case :-(
>
>
>
> On 22/03/07, Davanum Srinivas <davanum@gmail.com> wrote:
> > nope. please log a jira bug with enough code for us to recreate the
> problem.
> >
> > thanks,
> > dims
> >
> > On 3/22/07, D <textnode@gmail.com> wrote:
> > > Thanks Davanum,
> > >
> > > That resolved the issue on the request side, but unfortunately what
> looks
> > > (to me?!) like a similar error now occurs when the server is serializing
> its
> > > response.
> > >
> > > (This is the same client and server, generated successfully using
> > > wsdl2java).
> > >
> > > org.apache.axis2.AxisFault: unknown
> > >         at
> > >
> org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:271)
> > >         at
> > >
> org.apache.axis2.description.OutInAxisOperationClient.execute
> > > (OutInAxisOperation.java:202)
> > >         at
> > >
> com.xyz.generated.wsmms.send.MmsSendServiceStub.SendMms(MmsSendServiceStub.java:184)
> > >         at
> > > com.xyz.wsmms.test.MMSSend.execute(MMSSend.java :161)
> > >         at com.xyz.wsmms.test.MMSSend.main (MMSSend.java:283)
> > > Caused by: java.lang.Exception: java.lang.NullPointerException
> > >         at
> > > com.ctc.wstx.sw.BaseNsStreamWriter.doWriteDefaultNs
> (BaseNsStreamWriter.java:528)
> > >         at
> > >
> com.ctc.wstx.sw.SimpleNsStreamWriter.writeDefaultNamespace
> > > (SimpleNsStreamWriter.java:111)
> > >         at
> > > com.ctc.wstx.sw.SimpleNsStreamWriter.writeNamespace
> (SimpleNsStreamWriter.java:119)
> > >         at
> > >
> org.apache.axiom.om.impl.MTOMXMLStreamWriter.writeNamespace(MTOMXMLStreamWriter.java
> > > :146)
> > >         at
> > >
> org.apache.axiom.om.impl.serialize.StreamingOMSerializer.serializeElement
> (StreamingOMSerializer.java:243)
> > >         at
> > >
> org.apache.axiom.om.impl.serialize.StreamingOMSerializer.serializeNode(StreamingOMSerializer.java
> > > :76)
> > >         at
> > >
> org.apache.axiom.om.impl.serialize.StreamingOMSerializer.serialize
> (StreamingOMSerializer.java:59)
> > >         at
> > >
> org.apache.axiom.om.impl.util.OMSerializerUtil.serializeByPullStream(OMSerializerUtil.java
> > > :473)
> > >         at
> > >
> org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize
> (OMElementImpl.java:823)
> > >         at
> > >
> org.apache.axiom.om.impl.llom.OMElementImpl.internalSerializeAndConsume(OMElementImpl.java:848)
> > >         at
> > >
> org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize
> (OMElementImpl.java:819)
> > >         at
> > >
> org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.internalSerialize(SOAPEnvelopeImpl.java:180)
> > >         at
> > >
> org.apache.axiom.om.impl.llom.OMElementImpl.internalSerializeAndConsume
> > > (OMElementImpl.java:848)
> > >         at
> > >
> org.apache.axiom.om.impl.llom.OMNodeImpl.serializeAndConsume(OMNodeImpl.java:429)
> > >         at
> > >
> org.apache.axis2.transport.http.CommonsHTTPTransportSender.sendUsingOutputStream
> (CommonsHTTPTransportSender.java
> > > :272)
> > >         at
> > >
> org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:208)
> > >         at
> > > org.apache.axis2.engine.AxisEngine.send
> (AxisEngine.java:674)
> > >         at
> > >
> org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.receive
> > > (AbstractInOutSyncMessageReceiver.java:48)
> > >         at
> > > org.apache.axis2.engine.AxisEngine.receive
> (AxisEngine.java:497)
> > >         at
> > >
> org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java
> > > :328)
> > >         at
> > > org.apache.axis2.transport.http.HTTPWorker.service
> (HTTPWorker.java:230)
> > >         at
> > >
> org.apache.axis2.transport.http.server.DefaultHttpServiceProcessor.doService(DefaultHttpServiceProcessor.java:189)
> > >          at
> > > org.apache.http.protocol.HttpService.handleRequest
> (HttpService.java:123)
> > >         at
> > >
> org.apache.axis2.transport.http.server.DefaultHttpServiceProcessor.run(DefaultHttpServiceProcessor.java:261)
> > >         at
> > >
> edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask
> (ThreadPoolExecutor.java:665)
> > >         at
> > >
> edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java
> > > :690)
> > >         at java.lang.Thread.run(Thread.java :619)
> > >
> > >         at org.apache.axis2.AxisFault.<init>(AxisFault.java:159)
> > >         ... 5 more
> > >
> > > This happens if my implementation of the service skeleton interface sets
> ANY
> > > of the fields in the abcType object (which is itself a member of the
> > > abcElementDocument object returned by the service method).
> > >
> > >
> > > Have you seen this before?
> > >
> > >
> > > Many Thanks,
> > > Darren
> > >
> > >
> > >
> > >
> > > On 3/16/07, Davanum Srinivas < davanum@gmail.com > wrote:
> > > >
> > > > Please don't use sun's stax parser, please use the one in axis2 dist
> > > > which is the woodstox parser.
> > > >
> > > > thanks,
> > > > dims
> > > >
> > > > On 3/16/07, D <textnode@gmail.com> wrote:
> > > > > Hi Folks,
> > > > >
> > > > > Please can you help....I have generated a webservice client from
a
> wsdl
> > > > > using wsdl2java.
> > > > >
> > > > > When the stub is used to invoke the webservice the following
> exception
> > > > > occurs:
> > > > >
> > > > > java.lang.NullPointerException
> > > > >         at
> > > > >
> com.sun.xml.stream.writers.UTF8OutputStreamWriter.write
> > > (UTF8OutputStreamWriter.java:128)
> > > > >         at
> > > > >
> > >
> com.sun.xml.stream.writers.XMLStreamWriterImpl.writeDefaultNamespace
> (XMLStreamWriterImpl.java:728)
> > > > >         at
> > > > >
> > >
> com.sun.xml.stream.writers.XMLStreamWriterImpl.writeNamespace
> > > (XMLStreamWriterImpl.java:914)
> > > > >         at
> > > > >
> > >
> org.apache.axiom.om.impl.MTOMXMLStreamWriter.writeNamespace(MTOMXMLStreamWriter.java:146)
> > > > >         at
> > > > >
> > >
> org.apache.axiom.om.impl.serialize.StreamingOMSerializer.serializeElement
> > > > > (StreamingOMSerializer.java:243)
> > > > >         at
> > > > >
> > >
> org.apache.axiom.om.impl.serialize.StreamingOMSerializer.serializeNode(StreamingOMSerializer.java:76)
> > > > >         at
> > > > >
> > >
> org.apache.axiom.om.impl.serialize.StreamingOMSerializer.serialize
> > > > > (StreamingOMSerializer.java:59)
> > > > >         at
> > > > >
> > >
> org.apache.axiom.om.impl.util.OMSerializerUtil.serializeByPullStream
> (OMSerializerUtil.java:473)
> > > > >         at
> > > > >
> > >
> org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize
> > > (OMElementImpl.java
> > > > > :823)
> > > > >         at
> > > > >
> > >
> org.apache.axiom.om.impl.llom.OMElementImpl.internalSerializeAndConsume(OMElementImpl.java:848)
> > > > >         at
> > > > >
> > >
> org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize
> > > (OMElementImpl.java:819)
> > > > >         at
> > > > >
> > >
> org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.internalSerialize(SOAPEnvelopeImpl.java:180)
> > > > >         at
> > > > >
> > >
> org.apache.axiom.om.impl.llom.OMElementImpl.internalSerializeAndConsume
> > > (OMElementImpl.java:848)
> > > > >         at
> > > > >
> > >
> org.apache.axiom.om.impl.llom.OMNodeImpl.serializeAndConsume
> > > > > (OMNodeImpl.java:419)
> > > > >         at
> > > > >
> > >
> org.apache.axis2.transport.http.SOAPOverHTTPSender$AxisSOAPRequestEntity.handleOMOutput
> > > (SOAPOverHTTPSender.java:190)
> > > > >         at
> > > > >
> > >
> org.apache.axis2.transport.http.SOAPOverHTTPSender$AxisSOAPRequestEntity.writeRequest
> > > > > (SOAPOverHTTPSender.java:232)
> > > > >         at
> > > > >
> > >
> org.apache.commons.httpclient.methods.EntityEnclosingMethod.writeRequestBody
> > > (EntityEnclosingMethod.java:495)
> > > > >         at
> > > > >
> > >
> org.apache.commons.httpclient.HttpMethodBase.writeRequest
> > > > > (HttpMethodBase.java:1973)
> > > > >         at
> > > > >
> org.apache.commons.httpclient.HttpMethodBase.execute
> > > (HttpMethodBase.java:993)
> > > > >         at
> > > > >
> > >
> org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java
> > > > > :397)
> > > > >         at
> > > > >
> > >
> org.apache.commons.httpclient.HttpMethodDirector.executeMethod
> > > (HttpMethodDirector.java:170)
> > > > >         at
> > > > >
> > >
> org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
> > > > >         at
> > > > >
> org.apache.commons.httpclient.HttpClient.executeMethod
> > > > > ( HttpClient.java:346)
> > > > >         at
> > > > >
> > >
> org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:541)
> > > > >         at
> > > > >
> org.apache.axis2.transport.http.SOAPOverHTTPSender.send
> > > (SOAPOverHTTPSender.java
> > > > > :119)
> > > > >         at
> > > > >
> > >
> org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons
> (CommonsHTTPTransportSender.java:335)
> > > > >         at
> > > > >
> > >
> org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke
> > > (CommonsHTTPTransportSender.java
> > > > > :204)
> > > > >         at
> > > > >
> > >
> org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:674)
> > > > >         at
> > > > >
> > >
> org.apache.axis2.description.OutInAxisOperationClient.send
> (
> > > OutInAxisOperation.java:237)
> > > > >         at
> > > > >
> > >
> org.apache.axis2.description.OutInAxisOperationClient.execute
> > > > > (OutInAxisOperation.java:202)
> > > > >         at
> > > > >
> > >
> com.madeupnamexyz.appproviders.generated.wssms.send.SmsSendServiceStub.SendSms
> > > (SmsSendServiceStub.java:171)
> > > > >
> > > > > However, if I modify the stub by adding....
> > > > >
> > > > >         System.out.println ("ENVELOPESTARTS:");
> > > > >         try
> > > > >         {
> > > > >             env.serialize(System.out);
> > > > >         }
> > > > >         catch(javax.xml.stream.XMLStreamException
> ex)
> > > > >         {
> > > > >             System.out.println(ex.toString ());
> > > > >         }
> > > > >
> > > > >         System.out.println(":ENVELOPEENDS:");
> > > > >
> > > > > ....(i.e. I serialize the envelope to stdout) before the
> OperationClient
> > > > > execute method is called by the stub, the operation completes
> > > successfully.
> > > > >
> > > > >
> > > > > The WSDL and associated XSDs validate and wsdl2java gives no errors,
> so
> > > it
> > > > > looks like env.serialize() is fixing something in the envelope!
> > > > >
> > > > > The code using the client stub does not set anything to null and
the
> > > output
> > > > > from env.serialize() shows a valid soap envelope with all the
> expected
> > > > > fields populated with valid values.
> > > > >
> > > > >
> > > > > Has anyone else experienced this?
> > > > >
> > > > > Is this a known issue?
> > > > >
> > > > >
> > > > > Many Thanks,
> > > > > Darren
> > > > >
> > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > Davanum Srinivas :: http://wso2.org/ :: Oxygen for Web Services
> Developers
> > > >
> > > >
> > >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail:
> > > axis-user-unsubscribe@ws.apache.org
> > > > For additional commands, e-mail: axis-user-help@ws.apache.org
> > > >
> > > >
> > >
> > >
> >
> >
> > --
> > Davanum Srinivas :: http://wso2.org/ :: Oxygen for Web Services Developers
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-help@ws.apache.org
> >
> >
>
>

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


Mime
View raw message