3 Replies Latest reply on May 3, 2012 6:06 AM by ffang

    CXF - Error reading XMLStreamReader

    gauthamr

      Hi,

      I am facing issue w.r.t a cxf service while deploying to karaf.

      Cxf service was built using wsdl. I have packaged the app as an osgi bundle. Below mentioned is the stack trace.

      Also find the attachment for POM.xml

       

      I am using:

      servicemix-4.4.1-fuse-01-13

      camel-2.8.0-fuse-01-13

       

       

       

      org.apache.cxf.binding.soap.SoapFault: Error reading XMLStreamReader.

           at org.apache.cxf.binding.soap.saaj.SAAJInInterceptor$SAAJPreInInterceptor.handleMessage(SAAJInInterceptor.java:142)[133:org.apache.cxf.bundle:2.4.3.fuse-00-13]

           at org.apache.cxf.binding.soap.saaj.SAAJInInterceptor$SAAJPreInInterceptor.handleMessage(SAAJInInterceptor.java:105)[133:org.apache.cxf.bundle:2.4.3.fuse-00-13]

           at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)[133:org.apache.cxf.bundle:2.4.3.fuse-00-13]

           at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)[133:org.apache.cxf.bundle:2.4.3.fuse-00-13]

           at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:319)[133:org.apache.cxf.bundle:2.4.3.fuse-00-13]

           at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:287)[133:org.apache.cxf.bundle:2.4.3.fuse-00-13]

           at org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:72)[133:org.apache.cxf.bundle:2.4.3.fuse-00-13]

           at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:939)[114:org.eclipse.jetty.server:7.4.5.fuse20111017]

           at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:875)[114:org.eclipse.jetty.server:7.4.5.fuse20111017]

           at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)[114:org.eclipse.jetty.server:7.4.5.fuse20111017]

           at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:247)[114:org.eclipse.jetty.server:7.4.5.fuse20111017]

           at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110)[114:org.eclipse.jetty.server:7.4.5.fuse20111017]

           at org.eclipse.jetty.server.Server.handle(Server.java:346)[114:org.eclipse.jetty.server:7.4.5.fuse20111017]

           at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:438)[114:org.eclipse.jetty.server:7.4.5.fuse20111017]

           at org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:922)[114:org.eclipse.jetty.server:7.4.5.fuse20111017]

           at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:780)[109:org.eclipse.jetty.http:7.4.5.fuse20111017]

           at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:214)[109:org.eclipse.jetty.http:7.4.5.fuse20111017]

           at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:43)[114:org.eclipse.jetty.server:7.4.5.fuse20111017]

           at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:538)[110:org.eclipse.jetty.io:7.4.5.fuse20111017]

           at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:43)[110:org.eclipse.jetty.io:7.4.5.fuse20111017]

           at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:529)[115:org.eclipse.jetty.util:7.4.5.fuse20111017]

           at java.lang.Thread.run(Thread.java:662)[:1.6.0_30]

      Caused by: javax.xml.soap.SOAPException: Unable to create message factory for SOAP: Provider org.apache.axis2.saaj.MessageFactoryImpl not found

           at javax.xml.soap.MessageFactory.newInstance(MessageFactory.java:89)[106:org.apache.servicemix.specs.saaj-api-1.3:1.8.0]

           at org.apache.cxf.binding.soap.saaj.SAAJFactoryResolver.createMessageFactory(SAAJFactoryResolver.java:55)[133:org.apache.cxf.bundle:2.4.3.fuse-00-13]

           at org.apache.cxf.binding.soap.saaj.SAAJInInterceptor$SAAJPreInInterceptor.getFactory(SAAJInInterceptor.java:148)[133:org.apache.cxf.bundle:2.4.3.fuse-00-13]

           at org.apache.cxf.binding.soap.saaj.SAAJInInterceptor$SAAJPreInInterceptor.handleMessage(SAAJInInterceptor.java:131)[133:org.apache.cxf.bundle:2.4.3.fuse-00-13]

           ... 21 more

        • 1. Re: CXF - Error reading XMLStreamReader
          ffang

          Hi,

           

          This is a known issue and get fixed in      FUSE ESB 4.4.1-fuse-02 afterwards.

           

          The workaround is manually install saaj-impl bundle from console like

          install -s mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.saaj-impl/1.3.2_2

          before you install your customer bundle.

           

          Freeman

          • 2. Re: CXF - Error reading XMLStreamReader
            gauthamr

            Hi,

             

            I did wat you have mentioned. But i am facing password callback error as mentioned below in stacktrace. Is there any configuration that has to be done in karaf or cxf so that wspolicy can be accomodated?

             

            Attached sheet contains the policy that i have used in my wsdl.

             

            org.apache.cxf.binding.soap.SoapFault: General security error (WSSecurityEngine: No password callback supplied)

                 at org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.createSoapFault(WSS4JInInterceptor.java:643)[134:org.apache.cxf.bundle:2.4.3.fuse-00-13]

                 at org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:308)[134:org.apache.cxf.bundle:2.4.3.fuse-00-13]

                 at org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:85)[134:org.apache.cxf.bundle:2.4.3.fuse-00-13]

                 at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)[134:org.apache.cxf.bundle:2.4.3.fuse-00-13]

                 at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)[134:org.apache.cxf.bundle:2.4.3.fuse-00-13]

                 at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:319)[134:org.apache.cxf.bundle:2.4.3.fuse-00-13]

                 at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:287)[134:org.apache.cxf.bundle:2.4.3.fuse-00-13]

                 at org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:72)[134:org.apache.cxf.bundle:2.4.3.fuse-00-13]

                 at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:939)[114:org.eclipse.jetty.server:7.4.5.fuse20111017]

                 at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:875)[114:org.eclipse.jetty.server:7.4.5.fuse20111017]

                 at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)[114:org.eclipse.jetty.server:7.4.5.fuse20111017]

                 at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:247)[114:org.eclipse.jetty.server:7.4.5.fuse20111017]

                 at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110)[114:org.eclipse.jetty.server:7.4.5.fuse20111017]

                 at org.eclipse.jetty.server.Server.handle(Server.java:346)[114:org.eclipse.jetty.server:7.4.5.fuse20111017]

                 at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:438)[114:org.eclipse.jetty.server:7.4.5.fuse20111017]

                 at org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:922)[114:org.eclipse.jetty.server:7.4.5.fuse20111017]

                 at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:780)[109:org.eclipse.jetty.http:7.4.5.fuse20111017]

                 at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:220)[109:org.eclipse.jetty.http:7.4.5.fuse20111017]

                 at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:43)[114:org.eclipse.jetty.server:7.4.5.fuse20111017]

                 at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:538)[110:org.eclipse.jetty.io:7.4.5.fuse20111017]

                 at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:43)[110:org.eclipse.jetty.io:7.4.5.fuse20111017]

                 at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:529)[115:org.eclipse.jetty.util:7.4.5.fuse20111017]

                 at java.lang.Thread.run(Thread.java:662)[:1.6.0_30]

            Caused by: org.apache.ws.security.WSSecurityException: General security error (WSSecurityEngine: No password callback supplied)

                 at org.apache.ws.security.validate.UsernameTokenValidator.verifyDigestPassword(UsernameTokenValidator.java:155)[130:org.apache.ws.security.wss4j:1.6.1]

                 at org.apache.ws.security.validate.UsernameTokenValidator.verifyPlaintextPassword(UsernameTokenValidator.java:142)[130:org.apache.ws.security.wss4j:1.6.1]

                 at org.apache.ws.security.validate.UsernameTokenValidator.validate(UsernameTokenValidator.java:100)[130:org.apache.ws.security.wss4j:1.6.1]

                 at org.apache.ws.security.processor.UsernameTokenProcessor.handleUsernameToken(UsernameTokenProcessor.java:118)[130:org.apache.ws.security.wss4j:1.6.1]

                 at org.apache.ws.security.processor.UsernameTokenProcessor.handleToken(UsernameTokenProcessor.java:52)[130:org.apache.ws.security.wss4j:1.6.1]

                 at org.apache.ws.security.WSSecurityEngine.processSecurityHeader(WSSecurityEngine.java:396)[130:org.apache.ws.security.wss4j:1.6.1]

                 at org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:249)[134:org.apache.cxf.bundle:2.4.3.fuse-00-13]

                 ... 21 more

             

            Regards,

            Gautham

            • 3. Re: CXF - Error reading XMLStreamReader
              ffang

              Hi,

               

              In your bundle, you need provide a password callback handler to validate the password from incoming message, take a look at cxf-ws-security-osgi example shipped with kit to get more details.

               

              Freeman