users@jax-ws.java.net

RE: NPE inside SOAPEncoder

From: Ken Robinson <ken.robinson_at_apollogrp.edu>
Date: Tue, 24 Oct 2006 17:28:37 -0700

I guess I didn't try it with 2.1 before. With 2.1 the Source coming in
is now an instance of StAXSource rather than DOMSource as in 2.0.
Unfortunately, when trying to transform the source, it munges the xml
like so:

<ns:operation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xmlns:ns="someurl"
              xsi:schemaLocation="someurl http://someurl/schema.xsd">
   <someElement>someValue</someElement>
</{http://someurl}operation>


-----Original Message-----
From: Vivek.Pandey_at_Sun.COM [mailto:Vivek.Pandey_at_Sun.COM]
Sent: Tuesday, October 24, 2006 11:04 AM
To: users_at_jax-ws.dev.java.net
Subject: Re: NPE inside SOAPEncoder


Ken Robinson wrote:
> Thanks Vivek,
>
> I did try with 2.1 EA2, same result. Issue #94 now created.
>
>
Thanks for reporting the issue.

Whats the stack trace in 2.1? The issue 94 reported shows AJXWS 2.0
stack trace,

com.sun.xml.ws.protocol.soap.server.SOAPMessageDispatcher receive
SEVERE: Error in encoding SOAP Message
Error in encoding SOAP Message
        at
com.sun.xml.ws.encoding.soap.server.SOAPXMLEncoder.toSOAPMessage
(SOAPXMLEncoder.java:113)
        at
com.sun.xml.ws.protocol.soap.server.SOAPMessageDispatcher.makeSOAPMessag
e
(SOAPMessageDispatcher.java:350)
        at
com.sun.xml.ws.protocol.soap.server.SOAPMessageDispatcher.receive
(SOAPMessageDispatcher.java:155)

        at com.sun.xml.ws.server.Tie.handle(Tie.java:88)


If you're trying JAXWS 2.1 this code doesnt exist there.



-vivek.
> -----Original Message-----
> From: Vivek.Pandey_at_Sun.COM [mailto:Vivek.Pandey_at_Sun.COM]
> Sent: Tuesday, October 24, 2006 9:57 AM
> To: users_at_jax-ws.dev.java.net
> Subject: Re: NPE inside SOAPEncoder
>
>
> Hi Ken,
>
> The stack trace shows its coming from JAXWS 2.0 RI. Can you try JAXWS
> 2.1 EA2? It might have been fixed there as this part of the code was
> re-written there.
>
> Anyway this looks like a bug. Please report an issue at:
> http://jax-ws.dev.java.net/servlets/ProjectIssues.
>
> -vivek.
> Ken Robinson wrote:
>
>> Hi all -
>>
>> We've got a schema setup as follows, with one of the elements being
an
>> extension of an abstract supertype:
>>
>> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>> xmlns:base="http://generic" xmlns:v1="http://someurl"
>> targetNamespace="http://someurl">
>> <xsd:import namespace="http://generic" schemaLocation="base.xsd"/>
>> <xsd:element name="operation">
>> <xsd:complexType>
>> <xsd:sequence>
>> <xsd:element name="response" type="base:Response"/>
>> </xsd:sequence>
>> </xsd:complexType>
>> </xsd:element>
>> <xsd:complexType name="subtype">
>> <xsd:complexContent>
>> <xsd:extension base="base:supertype">
>> <xsd:sequence>
>> <xsd:element name="someElement" type="v1:someType"
>> minOccurs="0"/>
>> </xsd:sequence>
>> </xsd:extension>
>> </xsd:complexContent>
>> </xsd:complexType>
>> <xsd:complexType name="someType">
>> <xsd:sequence>
>> <xsd:element name="result" type="xsd:boolean"/>
>> </xsd:sequence>
>> </xsd:complexType>
>> </xsd:schema>
>>
>> With the supertype being defined as:
>>
>> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>> targetNamespace="http://generic"
>> xmlns:base="http://generic">
>> <xsd:complexType name="Response">
>> <xsd:sequence>
>> <xsd:element name="details" type="base:superType"/>
>> </xsd:sequence>
>> </xsd:complexType>
>> <xsd:complexType name="supertype" abstract="true">
>> </xsd:complexType>
>> </xsd:schema>
>>
>>
>> The problem I'm getting is an NPE inside SOAPEncoder at line 366 when
>>
> I
>
>> try to serialize a document conforming to this schema:
>>
>> com.sun.xml.ws.protocol.soap.server.SOAPMessageDispatcher receive
>> SEVERE: Error in encoding SOAP Message
>> Error in encoding SOAP Message
>> at
>>
>>
>
com.sun.xml.ws.encoding.soap.server.SOAPXMLEncoder.toSOAPMessage(SOAPXML
>
>> Encoder.java:113)
>> at
>>
>>
>
com.sun.xml.ws.protocol.soap.server.SOAPMessageDispatcher.makeSOAPMessag
>
>> e(SOAPMessageDispatcher.java:350)
>> at
>>
>>
>
com.sun.xml.ws.protocol.soap.server.SOAPMessageDispatcher.receive(SOAPMe
>
>> ssageDispatcher.java:155)
>> at com.sun.xml.ws.server.Tie.handle(Tie.java:88)
>> at
>>
>>
>
com.sun.xml.ws.transport.http.servlet.WSServletDelegate.handle(WSServlet
>
>> Delegate.java:333)
>> at
>>
>>
>
com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doPost(WSServlet
>
>> Delegate.java:288)
>> at
>>
>>
>
com.sun.xml.ws.transport.http.servlet.WSServlet.doPost(WSServlet.java:77
>
>> )
>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
>> at
>>
>>
>
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
>
>> tionFilterChain.java:237)
>> at
>>
>>
>
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
>
>> erChain.java:157)
>> at
>>
>>
>
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilte
>
>> r.java:75)
>> at
>>
>>
>
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
>
>> tionFilterChain.java:186)
>> at
>>
>>
>
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
>
>> erChain.java:157)
>> at
>>
>>
>
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv
>
>> e.java:214)
>> at
>>
>>
>
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveCo
>
>> ntext.java:104)
>> at
>>
>>
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:5
>
>> 20)
>> at
>>
>>
>
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardCon
>
>> textValve.java:198)
>> at
>>
>>
>
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv
>
>> e.java:152)
>> at
>>
>>
>
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveCo
>
>> ntext.java:104)
>> at
>>
>>
>
org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipa
>
>> lValve.java:44)
>> at
>>
>>
>
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveCo
>
>> ntext.java:102)
>> at
>>
>>
>
org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAs
>
>> sociationValve.java:169)
>> at
>>
>>
>
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveCo
>
>> ntext.java:102)
>> at
>>
>>
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:5
>
>> 20)
>> at
>>
>>
>
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java
>
>> :137)
>> at
>>
>>
>
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveCo
>
>> ntext.java:104)
>> at
>>
>>
>
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java
>
>> :118)
>> at
>>
>>
>
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveCo
>
>> ntext.java:102)
>> at
>>
>>
>
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:535
>
>> )
>> at
>>
>>
>
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveCo
>
>> ntext.java:102)
>> at
>>
>>
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:5
>
>> 20)
>> at
>>
>>
>
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.
>
>> java:109)
>> at
>>
>>
>
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveCo
>
>> ntext.java:104)
>> at
>>
>>
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:5
>
>> 20)
>> at
>> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
>> at
>>
>>
>
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
>
>> at
>>
>>
>
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:79
>
>> 9)
>> at
>>
>>
>
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processC
>
>> onnection(Http11Protocol.java:705)
>> at
>>
>>
>
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:57
>
>> 7)
>> at
>>
>>
>
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool
>
>> .java:683)
>> at java.lang.Thread.run(Thread.java:595)
>> Caused by: java.lang.NullPointerException
>> at
>>
>>
>
com.sun.xml.ws.encoding.soap.SOAPEncoder.serializeReader(SOAPEncoder.jav
>
>> a:365)
>> at
>>
>>
>
com.sun.xml.ws.encoding.soap.SOAPEncoder.serializeSource(SOAPEncoder.jav
>
>> a:437)
>> at
>>
>>
>
com.sun.xml.ws.encoding.soap.SOAPEncoder.writeBody(SOAPEncoder.java:573)
>
>> at
>>
>>
>
com.sun.xml.ws.encoding.soap.server.SOAPXMLEncoder.toSOAPMessage(SOAPXML
>
>> Encoder.java:95)
>> ... 41 more
>>
>> An example instance doc:
>>
>> <ns:operation xsi:schemaLocation="http://someurl
>> http://someurl/schema.xsd" xmlns:ns="http://someurl"
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
>> <response>
>> <message/>
>> <details xsi:type="ns:subtype" xmlns:ns="http://someurl"
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
>> <someElement>
>> <result>true</result>
>> </someElement>
>> </details >
>> </response>
>> </ns:operation>
>>
>> ---------------------------------------------------------------------
>> 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