10 Replies Latest reply on Aug 16, 2011 11:21 AM by ddc

    Problem accessing /cxf/HelloWorld

    ddc

      I went through the install guide with version 4.4 of the ESB on windows 7.  I'm now working through the product introduction document.  After I deploy the cxf-osgi example, I get the following error in the browser when I attempt to get the hello world wsdl (http://localhost:8181/cxf/HelloWorld?wsdl):

      -


      HTTP ERROR 500

       

      Problem accessing /cxf/HelloWorld. Reason:

       

          Requested factory com.ctc.wstx.stax.WstxOutputFactory cannot be located.  Classloader =BundleDelegatingClassLoader for

       

      Caused by:

       

      javax.xml.stream.FactoryConfigurationError: Requested factory com.ctc.wstx.stax.WstxOutputFactory cannot be located.  Classloader =BundleDelegatingClassLoader for

           at javax.xml.stream.FactoryLocator.loadFactory(FactoryLocator.java:126)

           at javax.xml.stream.FactoryLocator.locate(FactoryLocator.java:115)

           at javax.xml.stream.FactoryLocator.locate(FactoryLocator.java:51)

           at javax.xml.stream.XMLOutputFactory.newInstance(XMLOutputFactory.java:29)

           at org.apache.cxf.staxutils.StaxUtils.getXMLOutputFactory(StaxUtils.java:178)

           at org.apache.cxf.staxutils.StaxUtils.createXMLStreamWriter(StaxUtils.java:229)

           at org.apache.cxf.frontend.WSDLGetInterceptor.writeResponse(WSDLGetInterceptor.java:274)

           at org.apache.cxf.frontend.WSDLGetInterceptor.handleMessage(WSDLGetInterceptor.java:121)

           at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)

           at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:118)

           at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:206)

           at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:218)

           at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:200)

           at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:113)

           at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:184)

           at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:112)

           at javax.servlet.http.HttpServlet.service(HttpServlet.java:575)

           at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:163)

           at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:538)

           at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:478)

           at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:70)

           at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)

           at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:517)

           at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:225)

           at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:937)

           at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:116)

           at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:406)

           at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:183)

           at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:871)

           at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)

           at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:72)

           at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110)

           at org.eclipse.jetty.server.Server.handle(Server.java:346)

           at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:589)

           at org.eclipse.jetty.server.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:1048)

           at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:601)

           at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:214)

           at org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:411)

           at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:531)

           at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:40)

           at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:529)

           at java.lang.Thread.run(Thread.java:619)

       

      Powered by Jetty://

      -


       

      Any ideas on what might be causing the example to fail & how to fix it?

       

      David

        • 1. Re: Problem accessing /cxf/HelloWorld
          ddc

          Here's how I got this working:

           

          karaf@root> features:install  woodstox

           

          I know very little about features and bundles at this point, but I'm left wondering if there is a missing dependency somewhere?  IOW, when I installed the cxf-osgi example feature, I think it automatically installed the cxf feature.  If the cxf feature needs the woodstox feature to expose a web service wsdl, then shouldn't that have happened automatically?

           

          David

          • 2. Re: Problem accessing /cxf/HelloWorld
            ddc

            looking 1 level deeper:

             

            karaf@root> features:info  woodstox | grep st.x

            Description of woodstox 4.0.8 feature

              mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.stax-api-1.0/1.8.0

              mvn:org.codehaus.woodstox/stax2-api/3.0.2

              mvn:org.codehaus.woodstox/woodstox-core-asl/4.0.8

             

            karaf@root> features:info  cxf | grep st.x

              mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.stax-api-1.0/1.8.0

              mvn:org.codehaus.woodstox/stax2-api/3.0.2

              mvn:org.codehaus.woodstox/woodstox-core-asl/4.1.1

             

            It appears that the woodstox packages are directly included in the cxf feature rather than pulled in via dependency.  However there is a version difference where the cxf features pulls in a newer version of the woodstox-core-asl (4.11 vs 4.08).  Was WstxOutputFactory removed in version 4.11?  Since the example is now working for me, I'm not going to dig any further, but someone may want to check into this a bit further.

             

            David

            • 3. Re: Problem accessing /cxf/HelloWorld
              ffang

              Hi,

               

              A few questions for you.

               

              1. What's the exact fuse esb 4.4 version you're using?

               

              2. Did you try the cxf-osgi example shipped with kit without modifying it? and you use

              features:install examples-cxf-osgi to install this example?

               

              3. Does your machine has internet connection?

               

              4. When you start FUSE ESB, is there any exception in data/log/servicemix.log?

               

              Freeman

              • 4. Re: Problem accessing /cxf/HelloWorld
                ddc

                Hi Freeman,

                 

                1. Version

                 

                The download filename is apache-servicemix-4.4.0-fuse-00-43.zip.  If you need more version information, please let me know where I should look for it.

                 

                2. Did you try the cxf-osgi example shipped with kit without modifying it?

                 

                Yes

                 

                and you use features:install examples-cxf-osgi to install this example?

                 

                Yes

                 

                3. Does your machine has internet connection?

                 

                Yes

                 

                4. When you start FUSE ESB, is there any exception in data/log/servicemix.log? 

                 

                No.  No stack traces until I request the wsdl from the browser.

                 

                I attached the logfile from the following sequence of actions:

                 

                karaf@root: delete data directory

                karaf@root: servicemix.bat

                karaf@root: features:install examples-cxf-osgi

                browser: get http://localhost:8181/cxf/HelloWorld?wsdl

                 

                David

                • 5. Re: Problem accessing /cxf/HelloWorld
                  ffang

                  Hi,

                   

                  From your browser, could you try with

                   

                  http://your_ip:8181/cxf/HelloWorld?wsdl

                   

                  but not

                  http://localhost:8181/cxf/HelloWorld?wsdl

                   

                  to see if it helps?

                  I've encountered localhost doesn't work which is caused by my incorrect hosts configuration.

                   

                  Freeman

                  • 6. Re: Problem accessing /cxf/HelloWorld
                    ddc

                    sorry, using ip instead of localhost yields same result

                     

                    installing the woodstox feature "fixes" both forms of URL

                     

                    David

                    • 7. Re: Problem accessing /cxf/HelloWorld
                      ffang

                      Hi,

                       

                      woodstox feature should get installed by default, I assume you change some configuration for FUSE ESB before you start it and install example-cxf-osgi,right?

                       

                      Freeman

                      • 8. Re: Problem accessing /cxf/HelloWorld
                        ddc

                        Here's the only thing I did that might be unusual:

                         

                        In the install guide, chapter 2, there is an optional step of removing the jbi container.

                         

                        I removed jbi-* & servicemix-* from featuresBoot in etc/org.apache.karaf.features.cfg

                         

                        Tomorrow morning I will try again with the original features.cfg file...

                         

                        David

                        • 9. Re: Problem accessing /cxf/HelloWorld
                          ffang

                          Hi,

                           

                          I can reproduce it now.

                          Anyway, cxf-osgi example shouldn't rely on the jbi related feature installation.

                          I'll create an internal jira to fix it.

                          You can edit

                          $FUSE_ESB/system/org/apache/servicemix/apache-servicemix/4.4.0-fuse-00-43/apache-servicemix-4.4.0-fuse-00-43-features.xml

                           

                          find the cxf feature, add

                           

                          there as a workaround.

                           

                          Thanks for letting us know this issue.

                           

                          Freeman

                          • 10. Re: Problem accessing /cxf/HelloWorld
                            ddc

                            Thank you for looking into it Freeman

                             

                            Edited by: ddc on Aug 16, 2011 3:21 PM