You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Daniel Berg (JIRA)" <ji...@apache.org> on 2010/01/19 16:52:54 UTC

[jira] Created: (CXF-2626) xmlbean databinding nullpointer

xmlbean databinding nullpointer
-------------------------------

                 Key: CXF-2626
                 URL: https://issues.apache.org/jira/browse/CXF-2626
             Project: CXF
          Issue Type: Bug
          Components: OtherDatabindings
    Affects Versions: 2.2.5
            Reporter: Daniel Berg
            Priority: Minor


I ran into this little code in the xmlbeans data binding, that always seems to end up in a NullpointerException. 

I have a simple webservice(as simple as they get) using previously generated xmlbean from a schema. 
The write method gets called with my xmlbean and a valid writer, calls write with MessagePartInfo as null , and a nullpointer exception occurs.

{code:title=org.apache.cxf.xmlbeans.DataWriterImpl.java}
    public void write(Object obj, XMLStreamWriter output) {
        write(obj, null, output);
    }
    
    public void write(Object obj, MessagePartInfo part, XMLStreamWriter output) {
        try {
            Class<?> typeClass = part.getTypeClass();
.. snip
{code}
{code:title=stack}
	DataWriterImpl.write(Object, Object) line: 56	
	DataBindingProvider.writeToWriter(XMLStreamWriter, Object) line: 106	
	DataBindingProvider.writeTo(Object, Class<?>, Type, Annotation[], MediaType, MultivaluedMap<String,Object>, OutputStream) line: 98	
	JAXRSOutInterceptor.serializeMessage(Message, Response, OperationResourceInfo, boolean) line: 232	
	JAXRSOutInterceptor.processResponse(Message) line: 137	
	JAXRSOutInterceptor.handleMessage(Message) line: 77	
	PhaseInterceptorChain.doIntercept(Message) line: 236	
	OutgoingChainInterceptor.handleMessage(Message) line: 76	
	PhaseInterceptorChain.doIntercept(Message) line: 236	
	ChainInitiationObserver.onMessage(Message) line: 109	
	ServletDestination.invoke(ServletConfig, ServletContext, HttpServletRequest, HttpServletResponse) line: 98	
	ServletController.invokeDestination(HttpServletRequest, HttpServletResponse, ServletDestination) line: 394	
	ServletController.invoke(HttpServletRequest, HttpServletResponse) line: 133	
	CXFServlet(AbstractCXFServlet).invoke(HttpServletRequest, HttpServletResponse) line: 142	
	CXFServlet(AbstractHTTPServlet).handleRequest(HttpServletRequest, HttpServletResponse) line: 179	
	CXFServlet(AbstractHTTPServlet).doGet(HttpServletRequest, HttpServletResponse) line: 108	
	CXFServlet(HttpServlet).service(HttpServletRequest, HttpServletResponse) line: 707	
	CXFServlet(AbstractHTTPServlet).service(ServletRequest, ServletResponse) line: 159	
	StubSecurityHelper$ServletServiceAction.run() line: 227	
...snip
{code}
{code:title=jaxrs configuration}

<jaxrs:server id="flightplanRest" address="/flightplanRest">

	<jaxrs:serviceBeans>
		<ref bean="flightplanRestServiceBean"/>
	</jaxrs:serviceBeans>
	
	<jaxrs:schemaLocations>
		<jaxrs:schemaLocation>classpath:/domainmodel/Flightplan.xsd</jaxrs:schemaLocation>
	</jaxrs:schemaLocations>
	<jaxrs:dataBinding>
		<bean class="org.apache.cxf.xmlbeans.XmlBeansDataBinding"/>
	</jaxrs:dataBinding>
</jaxrs:server>
{code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CXF-2626) xmlbean databinding nullpointer

Posted by "Daniel Berg (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-2626?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12802348#action_12802348 ] 

Daniel Berg commented on CXF-2626:
----------------------------------

Using org.apache.cxf.jaxrs.provider.XMLBeansElementProvider as a jaxrs:provider works like a charm, thanks :)

I'll try to make a test case/simpler service reproducing the bug above, but that will not be for a week or two.

> xmlbean databinding nullpointer
> -------------------------------
>
>                 Key: CXF-2626
>                 URL: https://issues.apache.org/jira/browse/CXF-2626
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS, OtherDatabindings
>    Affects Versions: 2.2.5
>            Reporter: Daniel Berg
>            Priority: Minor
>
> I ran into this little code in the xmlbeans data binding, that always seems to end up in a NullpointerException. 
> I have a simple webservice(as simple as they get) using previously generated xmlbean from a schema. 
> The write method gets called with my xmlbean and a valid writer, calls write with MessagePartInfo as null , and a nullpointer exception occurs.
> {code:title=org.apache.cxf.xmlbeans.DataWriterImpl.java}
>     public void write(Object obj, XMLStreamWriter output) {
>         write(obj, null, output);
>     }
>     
>     public void write(Object obj, MessagePartInfo part, XMLStreamWriter output) {
>         try {
>             Class<?> typeClass = part.getTypeClass();
> .. snip
> {code}
> {code:title=stack}
> 	DataWriterImpl.write(Object, Object) line: 56	
> 	DataBindingProvider.writeToWriter(XMLStreamWriter, Object) line: 106	
> 	DataBindingProvider.writeTo(Object, Class<?>, Type, Annotation[], MediaType, MultivaluedMap<String,Object>, OutputStream) line: 98	
> 	JAXRSOutInterceptor.serializeMessage(Message, Response, OperationResourceInfo, boolean) line: 232	
> 	JAXRSOutInterceptor.processResponse(Message) line: 137	
> 	JAXRSOutInterceptor.handleMessage(Message) line: 77	
> 	PhaseInterceptorChain.doIntercept(Message) line: 236	
> 	OutgoingChainInterceptor.handleMessage(Message) line: 76	
> 	PhaseInterceptorChain.doIntercept(Message) line: 236	
> 	ChainInitiationObserver.onMessage(Message) line: 109	
> 	ServletDestination.invoke(ServletConfig, ServletContext, HttpServletRequest, HttpServletResponse) line: 98	
> 	ServletController.invokeDestination(HttpServletRequest, HttpServletResponse, ServletDestination) line: 394	
> 	ServletController.invoke(HttpServletRequest, HttpServletResponse) line: 133	
> 	CXFServlet(AbstractCXFServlet).invoke(HttpServletRequest, HttpServletResponse) line: 142	
> 	CXFServlet(AbstractHTTPServlet).handleRequest(HttpServletRequest, HttpServletResponse) line: 179	
> 	CXFServlet(AbstractHTTPServlet).doGet(HttpServletRequest, HttpServletResponse) line: 108	
> 	CXFServlet(HttpServlet).service(HttpServletRequest, HttpServletResponse) line: 707	
> 	CXFServlet(AbstractHTTPServlet).service(ServletRequest, ServletResponse) line: 159	
> 	StubSecurityHelper$ServletServiceAction.run() line: 227	
> ...snip
> {code}
> {code:title=jaxrs configuration}
> <jaxrs:server id="flightplanRest" address="/flightplanRest">
> 	<jaxrs:serviceBeans>
> 		<ref bean="flightplanRestServiceBean"/>
> 	</jaxrs:serviceBeans>
> 	
> 	<jaxrs:schemaLocations>
> 		<jaxrs:schemaLocation>classpath:/domainmodel/Flightplan.xsd</jaxrs:schemaLocation>
> 	</jaxrs:schemaLocations>
> 	<jaxrs:dataBinding>
> 		<bean class="org.apache.cxf.xmlbeans.XmlBeansDataBinding"/>
> 	</jaxrs:dataBinding>
> </jaxrs:server>
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CXF-2626) xmlbean databinding nullpointer

Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-2626?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12802326#action_12802326 ] 

Sergey Beryozkin commented on CXF-2626:
---------------------------------------

Can you please try to register 

org.apache.cxf.jaxrs.provider.XMLBeansElementProvider as a jaxrs:provider, instead of using jaxrs:dataBinding ?

and I will look into this issue... If you could post a sample service I can test then it can help...

cheers, Sergey

> xmlbean databinding nullpointer
> -------------------------------
>
>                 Key: CXF-2626
>                 URL: https://issues.apache.org/jira/browse/CXF-2626
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS, OtherDatabindings
>    Affects Versions: 2.2.5
>            Reporter: Daniel Berg
>            Priority: Minor
>
> I ran into this little code in the xmlbeans data binding, that always seems to end up in a NullpointerException. 
> I have a simple webservice(as simple as they get) using previously generated xmlbean from a schema. 
> The write method gets called with my xmlbean and a valid writer, calls write with MessagePartInfo as null , and a nullpointer exception occurs.
> {code:title=org.apache.cxf.xmlbeans.DataWriterImpl.java}
>     public void write(Object obj, XMLStreamWriter output) {
>         write(obj, null, output);
>     }
>     
>     public void write(Object obj, MessagePartInfo part, XMLStreamWriter output) {
>         try {
>             Class<?> typeClass = part.getTypeClass();
> .. snip
> {code}
> {code:title=stack}
> 	DataWriterImpl.write(Object, Object) line: 56	
> 	DataBindingProvider.writeToWriter(XMLStreamWriter, Object) line: 106	
> 	DataBindingProvider.writeTo(Object, Class<?>, Type, Annotation[], MediaType, MultivaluedMap<String,Object>, OutputStream) line: 98	
> 	JAXRSOutInterceptor.serializeMessage(Message, Response, OperationResourceInfo, boolean) line: 232	
> 	JAXRSOutInterceptor.processResponse(Message) line: 137	
> 	JAXRSOutInterceptor.handleMessage(Message) line: 77	
> 	PhaseInterceptorChain.doIntercept(Message) line: 236	
> 	OutgoingChainInterceptor.handleMessage(Message) line: 76	
> 	PhaseInterceptorChain.doIntercept(Message) line: 236	
> 	ChainInitiationObserver.onMessage(Message) line: 109	
> 	ServletDestination.invoke(ServletConfig, ServletContext, HttpServletRequest, HttpServletResponse) line: 98	
> 	ServletController.invokeDestination(HttpServletRequest, HttpServletResponse, ServletDestination) line: 394	
> 	ServletController.invoke(HttpServletRequest, HttpServletResponse) line: 133	
> 	CXFServlet(AbstractCXFServlet).invoke(HttpServletRequest, HttpServletResponse) line: 142	
> 	CXFServlet(AbstractHTTPServlet).handleRequest(HttpServletRequest, HttpServletResponse) line: 179	
> 	CXFServlet(AbstractHTTPServlet).doGet(HttpServletRequest, HttpServletResponse) line: 108	
> 	CXFServlet(HttpServlet).service(HttpServletRequest, HttpServletResponse) line: 707	
> 	CXFServlet(AbstractHTTPServlet).service(ServletRequest, ServletResponse) line: 159	
> 	StubSecurityHelper$ServletServiceAction.run() line: 227	
> ...snip
> {code}
> {code:title=jaxrs configuration}
> <jaxrs:server id="flightplanRest" address="/flightplanRest">
> 	<jaxrs:serviceBeans>
> 		<ref bean="flightplanRestServiceBean"/>
> 	</jaxrs:serviceBeans>
> 	
> 	<jaxrs:schemaLocations>
> 		<jaxrs:schemaLocation>classpath:/domainmodel/Flightplan.xsd</jaxrs:schemaLocation>
> 	</jaxrs:schemaLocations>
> 	<jaxrs:dataBinding>
> 		<bean class="org.apache.cxf.xmlbeans.XmlBeansDataBinding"/>
> 	</jaxrs:dataBinding>
> </jaxrs:server>
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CXF-2626) xmlbean databinding nullpointer

Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-2626?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12829627#action_12829627 ] 

Sergey Beryozkin commented on CXF-2626:
---------------------------------------

Hi Daniel : can you please post a very simple example which will help me to reproduce the issue. I just need a JAXRS resource with a single method which returns/accepts an XMLBeans bean (simplified as needed)

thanks, Sergey

> xmlbean databinding nullpointer
> -------------------------------
>
>                 Key: CXF-2626
>                 URL: https://issues.apache.org/jira/browse/CXF-2626
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS, OtherDatabindings
>    Affects Versions: 2.2.5
>            Reporter: Daniel Berg
>            Priority: Minor
>
> I ran into this little code in the xmlbeans data binding, that always seems to end up in a NullpointerException. 
> I have a simple webservice(as simple as they get) using previously generated xmlbean from a schema. 
> The write method gets called with my xmlbean and a valid writer, calls write with MessagePartInfo as null , and a nullpointer exception occurs.
> {code:title=org.apache.cxf.xmlbeans.DataWriterImpl.java}
>     public void write(Object obj, XMLStreamWriter output) {
>         write(obj, null, output);
>     }
>     
>     public void write(Object obj, MessagePartInfo part, XMLStreamWriter output) {
>         try {
>             Class<?> typeClass = part.getTypeClass();
> .. snip
> {code}
> {code:title=stack}
> 	DataWriterImpl.write(Object, Object) line: 56	
> 	DataBindingProvider.writeToWriter(XMLStreamWriter, Object) line: 106	
> 	DataBindingProvider.writeTo(Object, Class<?>, Type, Annotation[], MediaType, MultivaluedMap<String,Object>, OutputStream) line: 98	
> 	JAXRSOutInterceptor.serializeMessage(Message, Response, OperationResourceInfo, boolean) line: 232	
> 	JAXRSOutInterceptor.processResponse(Message) line: 137	
> 	JAXRSOutInterceptor.handleMessage(Message) line: 77	
> 	PhaseInterceptorChain.doIntercept(Message) line: 236	
> 	OutgoingChainInterceptor.handleMessage(Message) line: 76	
> 	PhaseInterceptorChain.doIntercept(Message) line: 236	
> 	ChainInitiationObserver.onMessage(Message) line: 109	
> 	ServletDestination.invoke(ServletConfig, ServletContext, HttpServletRequest, HttpServletResponse) line: 98	
> 	ServletController.invokeDestination(HttpServletRequest, HttpServletResponse, ServletDestination) line: 394	
> 	ServletController.invoke(HttpServletRequest, HttpServletResponse) line: 133	
> 	CXFServlet(AbstractCXFServlet).invoke(HttpServletRequest, HttpServletResponse) line: 142	
> 	CXFServlet(AbstractHTTPServlet).handleRequest(HttpServletRequest, HttpServletResponse) line: 179	
> 	CXFServlet(AbstractHTTPServlet).doGet(HttpServletRequest, HttpServletResponse) line: 108	
> 	CXFServlet(HttpServlet).service(HttpServletRequest, HttpServletResponse) line: 707	
> 	CXFServlet(AbstractHTTPServlet).service(ServletRequest, ServletResponse) line: 159	
> 	StubSecurityHelper$ServletServiceAction.run() line: 227	
> ...snip
> {code}
> {code:title=jaxrs configuration}
> <jaxrs:server id="flightplanRest" address="/flightplanRest">
> 	<jaxrs:serviceBeans>
> 		<ref bean="flightplanRestServiceBean"/>
> 	</jaxrs:serviceBeans>
> 	
> 	<jaxrs:schemaLocations>
> 		<jaxrs:schemaLocation>classpath:/domainmodel/Flightplan.xsd</jaxrs:schemaLocation>
> 	</jaxrs:schemaLocations>
> 	<jaxrs:dataBinding>
> 		<bean class="org.apache.cxf.xmlbeans.XmlBeansDataBinding"/>
> 	</jaxrs:dataBinding>
> </jaxrs:server>
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CXF-2626) xmlbean databinding nullpointer

Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-2626?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12802355#action_12802355 ] 

Sergey Beryozkin commented on CXF-2626:
---------------------------------------

> Using org.apache.cxf.jaxrs.provider.XMLBeansElementProvider as a jaxrs:provider works like a charm, thanks 

Excellent, thanks for confirming it. Please test XMLBeansElementProvider, it was contributed awhile back, we can add some more properties to it if needed. Example, the schema you register above will be ignored by XMLBeansElementProvider, so may be we can update it to do the XMLBeans schema validation. Can XMLBeans validate the data ? If you know how then I can update the provider. 

> I'll try to make a test case/simpler service reproducing the bug above, but that will not be for a week or two.

ok, no probs, given that XMLBeansElementProvider works, it is not that critical then...

cheers, Sergey

> xmlbean databinding nullpointer
> -------------------------------
>
>                 Key: CXF-2626
>                 URL: https://issues.apache.org/jira/browse/CXF-2626
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS, OtherDatabindings
>    Affects Versions: 2.2.5
>            Reporter: Daniel Berg
>            Priority: Minor
>
> I ran into this little code in the xmlbeans data binding, that always seems to end up in a NullpointerException. 
> I have a simple webservice(as simple as they get) using previously generated xmlbean from a schema. 
> The write method gets called with my xmlbean and a valid writer, calls write with MessagePartInfo as null , and a nullpointer exception occurs.
> {code:title=org.apache.cxf.xmlbeans.DataWriterImpl.java}
>     public void write(Object obj, XMLStreamWriter output) {
>         write(obj, null, output);
>     }
>     
>     public void write(Object obj, MessagePartInfo part, XMLStreamWriter output) {
>         try {
>             Class<?> typeClass = part.getTypeClass();
> .. snip
> {code}
> {code:title=stack}
> 	DataWriterImpl.write(Object, Object) line: 56	
> 	DataBindingProvider.writeToWriter(XMLStreamWriter, Object) line: 106	
> 	DataBindingProvider.writeTo(Object, Class<?>, Type, Annotation[], MediaType, MultivaluedMap<String,Object>, OutputStream) line: 98	
> 	JAXRSOutInterceptor.serializeMessage(Message, Response, OperationResourceInfo, boolean) line: 232	
> 	JAXRSOutInterceptor.processResponse(Message) line: 137	
> 	JAXRSOutInterceptor.handleMessage(Message) line: 77	
> 	PhaseInterceptorChain.doIntercept(Message) line: 236	
> 	OutgoingChainInterceptor.handleMessage(Message) line: 76	
> 	PhaseInterceptorChain.doIntercept(Message) line: 236	
> 	ChainInitiationObserver.onMessage(Message) line: 109	
> 	ServletDestination.invoke(ServletConfig, ServletContext, HttpServletRequest, HttpServletResponse) line: 98	
> 	ServletController.invokeDestination(HttpServletRequest, HttpServletResponse, ServletDestination) line: 394	
> 	ServletController.invoke(HttpServletRequest, HttpServletResponse) line: 133	
> 	CXFServlet(AbstractCXFServlet).invoke(HttpServletRequest, HttpServletResponse) line: 142	
> 	CXFServlet(AbstractHTTPServlet).handleRequest(HttpServletRequest, HttpServletResponse) line: 179	
> 	CXFServlet(AbstractHTTPServlet).doGet(HttpServletRequest, HttpServletResponse) line: 108	
> 	CXFServlet(HttpServlet).service(HttpServletRequest, HttpServletResponse) line: 707	
> 	CXFServlet(AbstractHTTPServlet).service(ServletRequest, ServletResponse) line: 159	
> 	StubSecurityHelper$ServletServiceAction.run() line: 227	
> ...snip
> {code}
> {code:title=jaxrs configuration}
> <jaxrs:server id="flightplanRest" address="/flightplanRest">
> 	<jaxrs:serviceBeans>
> 		<ref bean="flightplanRestServiceBean"/>
> 	</jaxrs:serviceBeans>
> 	
> 	<jaxrs:schemaLocations>
> 		<jaxrs:schemaLocation>classpath:/domainmodel/Flightplan.xsd</jaxrs:schemaLocation>
> 	</jaxrs:schemaLocations>
> 	<jaxrs:dataBinding>
> 		<bean class="org.apache.cxf.xmlbeans.XmlBeansDataBinding"/>
> 	</jaxrs:dataBinding>
> </jaxrs:server>
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CXF-2626) xmlbean databinding nullpointer

Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-2626?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12802351#action_12802351 ] 

Sergey Beryozkin commented on CXF-2626:
---------------------------------------

I tried to quickly check what might be happening here but I have to admit that without a simplified test case I won't be able to fix it before 2.2.6 gets released.

Can you please simply post : 

Service class with a single method only, the response type of this method is an important detail I need to know to do a basic test. If this response type has been generated from a schema then please also attach a sample schema (with the actual schema types/namespaces changed if needed)

thanks, Sergey

> xmlbean databinding nullpointer
> -------------------------------
>
>                 Key: CXF-2626
>                 URL: https://issues.apache.org/jira/browse/CXF-2626
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS, OtherDatabindings
>    Affects Versions: 2.2.5
>            Reporter: Daniel Berg
>            Priority: Minor
>
> I ran into this little code in the xmlbeans data binding, that always seems to end up in a NullpointerException. 
> I have a simple webservice(as simple as they get) using previously generated xmlbean from a schema. 
> The write method gets called with my xmlbean and a valid writer, calls write with MessagePartInfo as null , and a nullpointer exception occurs.
> {code:title=org.apache.cxf.xmlbeans.DataWriterImpl.java}
>     public void write(Object obj, XMLStreamWriter output) {
>         write(obj, null, output);
>     }
>     
>     public void write(Object obj, MessagePartInfo part, XMLStreamWriter output) {
>         try {
>             Class<?> typeClass = part.getTypeClass();
> .. snip
> {code}
> {code:title=stack}
> 	DataWriterImpl.write(Object, Object) line: 56	
> 	DataBindingProvider.writeToWriter(XMLStreamWriter, Object) line: 106	
> 	DataBindingProvider.writeTo(Object, Class<?>, Type, Annotation[], MediaType, MultivaluedMap<String,Object>, OutputStream) line: 98	
> 	JAXRSOutInterceptor.serializeMessage(Message, Response, OperationResourceInfo, boolean) line: 232	
> 	JAXRSOutInterceptor.processResponse(Message) line: 137	
> 	JAXRSOutInterceptor.handleMessage(Message) line: 77	
> 	PhaseInterceptorChain.doIntercept(Message) line: 236	
> 	OutgoingChainInterceptor.handleMessage(Message) line: 76	
> 	PhaseInterceptorChain.doIntercept(Message) line: 236	
> 	ChainInitiationObserver.onMessage(Message) line: 109	
> 	ServletDestination.invoke(ServletConfig, ServletContext, HttpServletRequest, HttpServletResponse) line: 98	
> 	ServletController.invokeDestination(HttpServletRequest, HttpServletResponse, ServletDestination) line: 394	
> 	ServletController.invoke(HttpServletRequest, HttpServletResponse) line: 133	
> 	CXFServlet(AbstractCXFServlet).invoke(HttpServletRequest, HttpServletResponse) line: 142	
> 	CXFServlet(AbstractHTTPServlet).handleRequest(HttpServletRequest, HttpServletResponse) line: 179	
> 	CXFServlet(AbstractHTTPServlet).doGet(HttpServletRequest, HttpServletResponse) line: 108	
> 	CXFServlet(HttpServlet).service(HttpServletRequest, HttpServletResponse) line: 707	
> 	CXFServlet(AbstractHTTPServlet).service(ServletRequest, ServletResponse) line: 159	
> 	StubSecurityHelper$ServletServiceAction.run() line: 227	
> ...snip
> {code}
> {code:title=jaxrs configuration}
> <jaxrs:server id="flightplanRest" address="/flightplanRest">
> 	<jaxrs:serviceBeans>
> 		<ref bean="flightplanRestServiceBean"/>
> 	</jaxrs:serviceBeans>
> 	
> 	<jaxrs:schemaLocations>
> 		<jaxrs:schemaLocation>classpath:/domainmodel/Flightplan.xsd</jaxrs:schemaLocation>
> 	</jaxrs:schemaLocations>
> 	<jaxrs:dataBinding>
> 		<bean class="org.apache.cxf.xmlbeans.XmlBeansDataBinding"/>
> 	</jaxrs:dataBinding>
> </jaxrs:server>
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CXF-2626) xmlbean databinding nullpointer

Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-2626?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sergey Beryozkin updated CXF-2626:
----------------------------------

    Component/s: JAX-RS

> xmlbean databinding nullpointer
> -------------------------------
>
>                 Key: CXF-2626
>                 URL: https://issues.apache.org/jira/browse/CXF-2626
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS, OtherDatabindings
>    Affects Versions: 2.2.5
>            Reporter: Daniel Berg
>            Priority: Minor
>
> I ran into this little code in the xmlbeans data binding, that always seems to end up in a NullpointerException. 
> I have a simple webservice(as simple as they get) using previously generated xmlbean from a schema. 
> The write method gets called with my xmlbean and a valid writer, calls write with MessagePartInfo as null , and a nullpointer exception occurs.
> {code:title=org.apache.cxf.xmlbeans.DataWriterImpl.java}
>     public void write(Object obj, XMLStreamWriter output) {
>         write(obj, null, output);
>     }
>     
>     public void write(Object obj, MessagePartInfo part, XMLStreamWriter output) {
>         try {
>             Class<?> typeClass = part.getTypeClass();
> .. snip
> {code}
> {code:title=stack}
> 	DataWriterImpl.write(Object, Object) line: 56	
> 	DataBindingProvider.writeToWriter(XMLStreamWriter, Object) line: 106	
> 	DataBindingProvider.writeTo(Object, Class<?>, Type, Annotation[], MediaType, MultivaluedMap<String,Object>, OutputStream) line: 98	
> 	JAXRSOutInterceptor.serializeMessage(Message, Response, OperationResourceInfo, boolean) line: 232	
> 	JAXRSOutInterceptor.processResponse(Message) line: 137	
> 	JAXRSOutInterceptor.handleMessage(Message) line: 77	
> 	PhaseInterceptorChain.doIntercept(Message) line: 236	
> 	OutgoingChainInterceptor.handleMessage(Message) line: 76	
> 	PhaseInterceptorChain.doIntercept(Message) line: 236	
> 	ChainInitiationObserver.onMessage(Message) line: 109	
> 	ServletDestination.invoke(ServletConfig, ServletContext, HttpServletRequest, HttpServletResponse) line: 98	
> 	ServletController.invokeDestination(HttpServletRequest, HttpServletResponse, ServletDestination) line: 394	
> 	ServletController.invoke(HttpServletRequest, HttpServletResponse) line: 133	
> 	CXFServlet(AbstractCXFServlet).invoke(HttpServletRequest, HttpServletResponse) line: 142	
> 	CXFServlet(AbstractHTTPServlet).handleRequest(HttpServletRequest, HttpServletResponse) line: 179	
> 	CXFServlet(AbstractHTTPServlet).doGet(HttpServletRequest, HttpServletResponse) line: 108	
> 	CXFServlet(HttpServlet).service(HttpServletRequest, HttpServletResponse) line: 707	
> 	CXFServlet(AbstractHTTPServlet).service(ServletRequest, ServletResponse) line: 159	
> 	StubSecurityHelper$ServletServiceAction.run() line: 227	
> ...snip
> {code}
> {code:title=jaxrs configuration}
> <jaxrs:server id="flightplanRest" address="/flightplanRest">
> 	<jaxrs:serviceBeans>
> 		<ref bean="flightplanRestServiceBean"/>
> 	</jaxrs:serviceBeans>
> 	
> 	<jaxrs:schemaLocations>
> 		<jaxrs:schemaLocation>classpath:/domainmodel/Flightplan.xsd</jaxrs:schemaLocation>
> 	</jaxrs:schemaLocations>
> 	<jaxrs:dataBinding>
> 		<bean class="org.apache.cxf.xmlbeans.XmlBeansDataBinding"/>
> 	</jaxrs:dataBinding>
> </jaxrs:server>
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.