Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-2626

xmlbean databinding nullpointer

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2.5
    • Fix Version/s: 2.3.2, 2.4
    • Component/s: JAX-RS, OtherDatabindings
    • Labels:
      None
    • Estimated Complexity:
      Moderate

      Description

      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.

      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
      
      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
      
      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>
      

        Attachments

          Activity

            People

            • Assignee:
              sergey_beryozkin Sergey Beryozkin
              Reporter:
              danielberg Daniel Berg
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: