Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-12758

SOAP request causing null namespace URI in SimpleNsStreamWriter camel-cxf/woodstox

    XMLWordPrintableJSON

Details

    • Unknown

    Description

      Getting NullPointer at com.ctc.wstx.sw.SimpleNsStreamWriter.writeNamespace(SimpleNsStreamWriter.java:134) because parameter nsURI is null. (full stack trace below)

      First call of this method prefix=”soapenv”, nsURI=null

      Second call: prefix=”soap”, nsURI=="http://schemas.xmlsoap.org/soap/envelope/" (I changed the value of nsURI in the debugger in the first call to arrive here)

      In general: if I change the nsURI in the debugger to the correct value or to an empty string,

      the request goes through without any error.

      Same SOAP request using SOAPUI 5.4 was working with the same application using an older version of camel-cxf (2.12.4) under Java 1.7

      My SOAP request:

      <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tss="http://axpo.ch/emis/v1/TimeseriesService">
             <soapenv:Header>
              <tss:sourceSystem>MySourceSystem</tss:sourceSystem>
          </soapenv:Header>
          <soapenv:Body>
                 <tss:send>
                       <correlationId>IN1806141130169762894</correlationId>
                       <collectionIdentifier>NA</collectionIdentifier>
                       <timeseriesList>
                           <timeseries>
                               <identifier>1234</identifier>
                               <measurementUnit>MW</measurementUnit>
                               <resolution>PT15M</resolution>
                               <periodList>
                                   <interval start="2018-06-27T22:00:00Z" quantity="0.041" status="VALID"/>
                                   <interval start="2018-06-28T21:45:00Z" quantity="0.036" status="VALID"/>
                               </periodList>
                           </timeseries>
                       </timeseriesList>
                 </tss:send>
          </soapenv:Body>
      </soapenv:Envelope>

      Error stack trace:

      com.ctc.wstx.sw.SimpleNsStreamWriter.writeNamespace(SimpleNsStreamWriter.java:134
      10:27:09,294 WARNING [org.apache.cxf.phase.PhaseInterceptorChain] (default task-118) Application {http://axpo.ch/emis/v1/TimeseriesService}TimeseriesService#{http://axpo.ch/emis/v1/TimeseriesService}send has thrown exception, unwinding now: org.apache.cxf.interceptor.Fault: Error during type conversion from type: org.apache.camel.converter.jaxp.XMLStreamReaderInputStream to the required type: javax.xml.stream.XMLStreamReader with value org.apache.camel.converter.jaxp.XMLStreamReaderInputStream@9c55922 due java.lang.NullPointerException
             at org.apache.camel.component.cxf.CxfConsumer$CxfConsumerInvoker.checkFailure(CxfConsumer.java:344) [camel-cxf-2.22.0.jar:2.22.0]
             at org.apache.camel.component.cxf.CxfConsumer$CxfConsumerInvoker.setResponseBack(CxfConsumer.java:318) [camel-cxf-2.22.0.jar:2.22.0]
             at org.apache.camel.component.cxf.CxfConsumer$CxfConsumerInvoker.syncInvoke(CxfConsumer.java:244) [camel-cxf-2.22.0.jar:2.22.0]
             at org.apache.camel.component.cxf.CxfConsumer$CxfConsumerInvoker.invoke(CxfConsumer.java:162) [camel-cxf-2.22.0.jar:2.22.0]
             at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:59) [cxf-core-3.2.5.jar:3.2.5]
             at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [rt.jar:1.8.0_144]
            at java.util.concurrent.FutureTask.run(FutureTask.java:266) [rt.jar:1.8.0_144]
             at org.apache.cxf.interceptor.ServiceInvokerInterceptor$2.run(ServiceInvokerInterceptor.java:126) [cxf-core-3.2.5.jar:3.2.5]
             at org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37) [cxf-core-3.2.5.jar:3.2.5]
             at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:131) [cxf-core-3.2.5.jar:3.2.5]
             at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308) [cxf-core-3.2.5.jar:3.2.5]
             at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121) [cxf-core-3.2.5.jar:3.2.5]
             at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:267) [cxf-rt-transports-http-3.2.5.jar:3.2.5]
             at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234) [cxf-rt-transports-http-3.2.5.jar:3.2.5]
             at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208) [cxf-rt-transports-http-3.2.5.jar:3.2.5]
             at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160) [cxf-rt-transports-http-3.2.5.jar:3.2.5]
             at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:216) [cxf-rt-transports-http-3.2.5.jar:3.2.5]
             at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:301) [cxf-rt-transports-http-3.2.5.jar:3.2.5]
             at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:220) [cxf-rt-transports-http-3.2.5.jar:3.2.5]
             at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) [jboss-servlet-api_3.1_spec-1.0.0.Final-redhat-1.jar:1.0.0.Final-redhat-1]
            at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:276) [cxf-rt-transports-http-3.2.5.jar:3.2.5]
             at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:74) [undertow-servlet-1.4.18.SP8-redhat-1.jar:1.4.18.SP8-redhat-1]
             at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62) [undertow-servlet-1.4.18.SP8-redhat-1.jar:1.4.18.SP8-redhat-1]
             at io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:65) [undertow-servlet-1.4.18.SP8-redhat-1.jar:1.4.18.SP8-redhat-1]
             at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) [undertow-servlet-1.4.18.SP8-redhat-1.jar:1.4.18.SP8-redhat-1]
             at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
             at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.4.18.SP8-redhat-1.jar:1.4.18.SP8-redhat-1]
             at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131) [undertow-servlet-1.4.18.SP8-redhat-.jar:1.4.18.SP8-redhat-1]

             at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57) [undertow-servlet-1.4.18.SP8-redhat-1.jar:1.4.18.SP8-redhat-1]

             at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.4.18.SP8-redhat-1.jar:1.4.18.SP8-redhat-1]

             at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46) [undertow-core-1.4.18.SP8-redhat-1.jar:1.4.18.SP8-redhat-1]

             at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64) [undertow-servlet-1.4.18.SP8-redhat-1.jar:1.4.18.SP8-redhat-1]

             at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60) [undertow-core-1.4.18.SP8-redhat-1.jar:1.4.18.SP8-redhat-1]

             at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77) [undertow-servlet-1.4.18.SP8-redhat-1.jar:1.4.18.SP8-redhat-1]

             at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50) [undertow-core-1.4.18.SP8-redhat-1.jar:1.4.18.SP8-redhat-1]

             at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43) [undertow-core-1.4.18.SP8-redhat-1.jar:1.4.18.SP8-redhat-1]

             at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.4.18.SP8-redhat-1.jar:1.4.18.SP8-redhat-1]

             at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)

             at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.4.18.SP8-redhat-1.jar:1.4.18.SP8-redhat-1]

             at org.wildfly.extension.undertow.deployment.GlobalRequestControllerHandler.handleRequest(GlobalRequestControllerHandler.java:68)

             at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.4.18.SP8-redhat-1.jar:1.4.18.SP8-redhat-1]

             at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:292) [undertow-servlet-1.4.18.SP8-redhat-1.jar:1.4.18.SP8-redhat-1]

             at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:81) [undertow-servlet-1.4.18.SP8-redhat-1.jar:1.4.18.SP8-redhat-1]

             at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:138) [undertow-servlet-1.4.18.SP8-redhat-1.jar:1.4.18.SP8-redhat-1]

             at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:135) [undertow-servlet-1.4.18.SP8-redhat-1.jar:1.4.18.SP8-redhat-1]

             at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48) [undertow-servlet-1.4.18.SP8-redhat-1.jar:1.4.18.SP8-redhat-1]

             at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43) [undertow-servlet-1.4.18.SP8-redhat-1.jar:1.4.18.SP8-redhat-1]

             at org.wildfly.extension.undertow.security.SecurityContextThreadSetupAction.lambda$create$0(SecurityContextThreadSetupAction.java:105)

             at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda{{monospaced text}}$create$0(UndertowDeploymentInfoService.java:1501)

             at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1501)

             at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1501)

             at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1501)

             at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:272) [undertow-servlet-1.4.18.SP8-redhat-1.jar:1.4.18.SP8-redhat-1]

             at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81) [undertow-servlet-1.4.18.SP8-redhat-1.jar:1.4.18.SP8-redhat-1]

             at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:104) [undertow-servlet-1.4.18.SP8-redhat-1.jar:1.4.18.SP8-redhat-1]

             at io.undertow.server.Connectors.executeRootHandler(Connectors.java:330) [undertow-core-1.4.18.SP8-redhat-1.jar:1.4.18.SP8-redhat-1]

             at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:812) [undertow-core-1.4.18.SP8-redhat-1.jar:1.4.18.SP8-redhat-1]

             at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [rt.jar:1.8.0_144]

             at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [rt.jar:1.8.0_144]

             at java.lang.Thread.run(Thread.java:748) [rt.jar:1.8.0_144]

      Caused by: org.apache.camel.TypeConversionException: Error during type conversion from type: org.apache.camel.converter.jaxp.XMLStreamReaderInputStream to the required type: javax.xml.stream.XMLStreamReader with value org.apache.camel.converter.jaxp.XMLStreamReaderInputStream@9c55922 due java.lang.NullPointerException

             at org.apache.camel.impl.converter.BaseTypeConverterRegistry.createTypeConversionException(BaseTypeConverterRegistry.java:667) [camel-core-2.22.0.jar:2.22.0]

             at org.apache.camel.impl.converter.BaseTypeConverterRegistry.convertTo(BaseTypeConverterRegistry.java:158) [camel-core-2.22.0.jar:2.22.0]

             at org.apache.camel.impl.converter.BaseTypeConverterRegistry.convertTo(BaseTypeConverterRegistry.java:129) [camel-core-2.22.0.jar:2.22.0]

             at org.apache.camel.converter.jaxb.JaxbDataFormat.unmarshal(JaxbDataFormat.java:273) [camel-jaxb-2.22.0.jar:2.22.0]

             at org.apache.camel.processor.UnmarshalProcessor.process(UnmarshalProcessor.java:69) [camel-core-2.22.0.jar:2.22.0]

             at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:548) [camel-core-2.22.0.jar:2.22.0]

             at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:201) [camel-core-2.22.0.jar:2.22.0]

             at org.apache.camel.processor.Pipeline.process(Pipeline.java:138) [camel-core-2.22.0.jar:2.22.0]

             at org.apache.camel.processor.Pipeline.process(Pipeline.java:101) [camel-core-2.22.0.jar:2.22.0]

             at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:201) [camel-core-2.22.0.jar:2.22.0]

             at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:97) [camel-core-2.22.0.jar:2.22.0]

             at org.apache.camel.component.cxf.CxfConsumer$CxfConsumerInvoker.syncInvoke(CxfConsumer.java:238) [camel-cxf-2.22.0.jar:2.22.0]

             ... 57 more

      Caused by: org.apache.camel.RuntimeCamelException: java.lang.NullPointerException

             at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1830) [camel-core-2.22.0.jar:2.22.0]

             at org.apache.camel.util.ObjectHelper.invokeMethod(ObjectHelper.java:1409) [camel-core-2.22.0.jar:2.22.0]

             at org.apache.camel.impl.converter.InstanceMethodTypeConverter.convertTo(InstanceMethodTypeConverter.java:79) [camel-core-2.22.0.jar:2.22.0]

             at org.apache.camel.impl.converter.BaseTypeConverterRegistry.doConvertTo(BaseTypeConverterRegistry.java:326) [camel-core-2.22.0.jar:2.22.0]

             at org.apache.camel.impl.converter.BaseTypeConverterRegistry.convertTo(BaseTypeConverterRegistry.java:141) [camel-core-2.22.0.jar:2.22.0]

             ... 67 more

      Caused by: java.lang.NullPointerException

             at com.ctc.wstx.sw.SimpleNsStreamWriter.writeNamespace(SimpleNsStreamWriter.java:134) [woodstox-core-5.0.3.jar:5.0.3]

             at org.apache.camel.converter.jaxp.XMLStreamReaderInputStream.ensureBuffering(XMLStreamReaderInputStream.java:111) [camel-core-2.22.0.jar:2.22.0]

             at org.apache.camel.converter.jaxp.XMLStreamReaderInputStream.read(XMLStreamReaderInputStream.java:68) [camel-core-2.22.0.jar:2.22.0]

             at java.io.BufferedInputStream.fill(BufferedInputStream.java:246) [rt.jar:1.8.0_144]

             at java.io.BufferedInputStream.read1(BufferedInputStream.java:286) [rt.jar:1.8.0_144]

             at java.io.BufferedInputStream.read(BufferedInputStream.java:345) [rt.jar:1.8.0_144]

             at com.ctc.wstx.io.StreamBootstrapper.ensureLoaded(StreamBootstrapper.java:482) [woodstox-core-5.0.3.jar:5.0.3]

             at com.ctc.wstx.io.StreamBootstrapper.resolveStreamEncoding(StreamBootstrapper.java:306) [woodstox-core-5.0.3.jar:5.0.3]

             at com.ctc.wstx.io.StreamBootstrapper.bootstrapInput(StreamBootstrapper.java:167) [woodstox-core-5.0.3.jar:5.0.3]

             at com.ctc.wstx.stax.WstxInputFactory.doCreateSR(WstxInputFactory.java:573) [woodstox-core-5.0.3.jar:5.0.3]

             at com.ctc.wstx.stax.WstxInputFactory.createSR(WstxInputFactory.java:633) [woodstox-core-5.0.3.jar:5.0.3]

             at com.ctc.wstx.stax.WstxInputFactory.createSR(WstxInputFactory.java:647) [woodstox-core-5.0.3.jar:5.0.3]

             at com.ctc.wstx.stax.WstxInputFactory.createXMLStreamReader(WstxInputFactory.java:334) [woodstox-core-5.0.3.jar:5.0.3]

             at _redirected.XMLInputFactory.createXMLStreamReader(_XMLInputFactory.java:139) [jboss-modules.jar:1.6.4.Final-redhat-1]

             at org.apache.camel.converter.jaxp.StaxConverter.createXMLStreamReader(StaxConverter.java:170) [camel-core-2.22.0.jar:2.22.0]

             at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.8.0_144]

             at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [rt.jar:1.8.0_144]

             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.8.0_144]

             at java.lang.reflect.Method.invoke(Method.java:498) [rt.jar:1.8.0_144]

             at org.apache.camel.util.ObjectHelper.invokeMethod(ObjectHelper.java:1405) [camel-core-2.22.0.jar:2.22.0]

      Attachments

        Activity

          People

            ramu11 Ramu
            juergen.fritz@irix.ch Jürgen Fritz
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: