11 Replies Latest reply on Mar 28, 2011 2:05 AM by ffang

    examples-cxf-osgi problem...

    dead_devil_66

      Greetings.

       

      I'm trying to understand the use of web services in Fuse ESB. But, as always with the examples, there are errors.... (pfffft)

       

      So...., i have installed the feature mentioned in the title, through karaf console.

       

      It's installed and running.

       

      Buuuuuuut, when i open client.html and click Submit, i get the following output, in the right window:

       

      STATUS: 0

       

      what is wrong????

        • 1. Re: examples-cxf-osgi problem...
          ffang

          Hi,

           

          You need tell us your exact FUSE ESB version, your JDK version, your platform, does your machine running example have internet connection?

           

          You can try to run

          mvn compile exec:java

          in examples/cxf-osgi folder to see if the java code client works.

           

          Also, when you install features:install examples-cxf-osgi, is there any exception from servicemix.log?

          You also can use osgi:list and osgi:headers to see if this example bundle get installed/started correctly.

           

          Freeman

          • 2. Re: examples-cxf-osgi problem...
            dead_devil_66

            Fuse ESB version:

             

            4.3.1

             

             

            Java version:

             

            java version "1.6.0_20"

            OpenJDK Runtime Environment (IcedTea6 1.9.7) (6b20-1.9.7-0ubuntu1)

            OpenJDK Server VM (build 19.0-b09, mixed mode)

             

             

            My platform:

             

            Ubuntu 10.10

             

             

            Yes, this machine has internet connection.

             

             

            When i run mvn compile exec:java in examples/cxf-osgi, i get the following output (after the download sentences):

             

            http://pastie.org/1722750

             

             

            I erased the previous log and started the fuse esb again. Here is the new log, after installing the example feature:

             

            http://pastie.org/1722830

             

             

            When i try to access, through the browser, to http://localhost:8181/cxf/HelloWorld?wsdl, i get the wsdl, as expected and nothing changes in the log file. When i use the client.html, i get STATUS: 0 in the right window and it's append to the log a new block of text:

             

            http://pastie.org/1722843

             

            to see the block, search for the new entry, after "18:40:27,899 | INFO "

            • 3. Re: examples-cxf-osgi problem...
              ffang

              Hi,

               

              For 4.3.1, we have 4.3.1-fuse-00-00 and 4.3.1-fuse-01-09 two versions, I tested both with java code client and brower client, works well from my side.

               

              Do you run the example with a clean installed FUSE ESB, without any changes for configuration?

               

              What kind of browser you're using? The exception when you use browser shows that the request message isn't complete when reach the server side, which I think could be a browser specific issue.

              But the exception when you use java code client shows can't connect to a listening port(there's no exception in servicemix.log), so I suspect you didn't test the two client ways with some condition, is it possible that when you run java code client, the FUSE ESB isn't started?

               

              Also I suspect this is a specific jdk issue, could you try with SUN's JDK to see if there's any difference?

               

              Freeman

              • 4. Re: examples-cxf-osgi problem...
                dead_devil_66

                thanks ffang.

                 

                I forgot to run fuse esb. lol (newbie here)

                 

                Now, i can't run the example through eclipse and by runnin mvn compile exec:java in cxf-osgi directory.

                 

                but the client.html is giving me the same problem. I'm trying with Midori and Google Chrome. Status 0 in both of them...

                • 5. Re: examples-cxf-osgi problem...
                  ffang

                  Hi,

                   

                  When you run java code client, is there any exception in servicemix.log?

                   

                  Also try with SUN's JDK, I strongly suspect it's a JDK specific issue now.

                   

                  Freeman

                  • 6. Re: examples-cxf-osgi problem...
                    dead_devil_66

                    ffang, seems that with firefox, i get the correct result.

                     

                    Many thanks ffang

                     

                    by the way, anyone had problems with Midori and Google Chrome, like i did???

                    • 7. Re: examples-cxf-osgi problem...
                      dead_devil_66

                      ok, i will try with sun jdk and report the results

                      • 8. Re: examples-cxf-osgi problem...
                        dead_devil_66

                        when i run the client.html using chrome, i get this output in the log:

                         

                        03:14:27,601 | WARN  | 0@qtp-20644102-0 | PhaseInterceptorChain            |  -  -  | Interceptor for HelloWorldImplService has thrown exception, unwinding now

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

                             at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:222)[137:org.apache.cxf.bundle:2.3.2.fuse-00-00]

                             at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:60)[137:org.apache.cxf.bundle:2.3.2.fuse-00-00]

                             at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)[137:org.apache.cxf.bundle:2.3.2.fuse-00-00]

                             at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:113)[137:org.apache.cxf.bundle:2.3.2.fuse-00-00]

                             at org.apache.cxf.transport.http_osgi.OsgiDestination.doMessage(OsgiDestination.java:79)[137:org.apache.cxf.bundle:2.3.2.fuse-00-00]

                             at org.apache.cxf.transport.http_osgi.OsgiServletController.invokeDestination(OsgiServletController.java:336)[137:org.apache.cxf.bundle:2.3.2.fuse-00-00]

                             at org.apache.cxf.transport.http_osgi.OsgiServletController.invoke(OsgiServletController.java:157)[137:org.apache.cxf.bundle:2.3.2.fuse-00-00]

                             at org.apache.cxf.transport.http_osgi.OsgiServlet.invoke(OsgiServlet.java:53)[137:org.apache.cxf.bundle:2.3.2.fuse-00-00]

                             at org.apache.cxf.transport.http_osgi.SpringOsgiServlet.invoke(SpringOsgiServlet.java:48)[137:org.apache.cxf.bundle:2.3.2.fuse-00-00]

                             at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:179)[137:org.apache.cxf.bundle:2.3.2.fuse-00-00]

                             at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doOptions(AbstractHTTPServlet.java:132)[137:org.apache.cxf.bundle:2.3.2.fuse-00-00]

                             at javax.servlet.http.HttpServlet.service(HttpServlet.java:604)[136:org.apache.geronimo.specs.geronimo-servlet_3.0_spec:1.0]

                             at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:159)[137:org.apache.cxf.bundle:2.3.2.fuse-00-00]

                             at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)[100:org.apache.servicemix.bundles.jetty:6.1.26.1-fuse]

                             at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:401)[100:org.apache.servicemix.bundles.jetty:6.1.26.1-fuse]

                             at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.handle(HttpServiceServletHandler.java:64)[104:org.ops4j.pax.web.pax-web-jetty:0.7.4]

                             at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)[100:org.apache.servicemix.bundles.jetty:6.1.26.1-fuse]

                             at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)[100:org.apache.servicemix.bundles.jetty:6.1.26.1-fuse]

                             at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.handle(HttpServiceContext.java:111)[104:org.ops4j.pax.web.pax-web-jetty:0.7.4]

                             at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:68)[104:org.ops4j.pax.web.pax-web-jetty:0.7.4]

                             at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)[100:org.apache.servicemix.bundles.jetty:6.1.26.1-fuse]

                             at org.mortbay.jetty.Server.handle(Server.java:326)[100:org.apache.servicemix.bundles.jetty:6.1.26.1-fuse]

                             at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)[100:org.apache.servicemix.bundles.jetty:6.1.26.1-fuse]

                             at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:928)[100:org.apache.servicemix.bundles.jetty:6.1.26.1-fuse]

                             at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:549)[100:org.apache.servicemix.bundles.jetty:6.1.26.1-fuse]

                             at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)[100:org.apache.servicemix.bundles.jetty:6.1.26.1-fuse]

                             at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)[100:org.apache.servicemix.bundles.jetty:6.1.26.1-fuse]

                             at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410)[100:org.apache.servicemix.bundles.jetty:6.1.26.1-fuse]

                             at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)[100:org.apache.servicemix.bundles.jetty:6.1.26.1-fuse]

                        Caused by: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog

                        at :

                             at com.ctc.wstx.sr.StreamScanner.throwUnexpectedEOF(StreamScanner.java:682)[86:woodstox-core-asl:4.0.8]

                             at com.ctc.wstx.sr.BasicStreamReader.handleEOF(BasicStreamReader.java:2090)[86:woodstox-core-asl:4.0.8]

                             at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:1996)[86:woodstox-core-asl:4.0.8]

                             at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1100)[86:woodstox-core-asl:4.0.8]

                             at com.ctc.wstx.sr.BasicStreamReader.nextTag(BasicStreamReader.java:1123)[86:woodstox-core-asl:4.0.8]

                             at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:122)[137:org.apache.cxf.bundle:2.3.2.fuse-00-00]

                             ... 28 more

                         

                         

                        and no, i don't get any exception when running the java client code

                        • 9. Re: examples-cxf-osgi problem...
                          ffang

                          Hi,

                           

                          You mean with java code client, it works, right?

                           

                          And for the browser client, Chrome doesn't work but firefox works, right?

                          If so, this is only a browser specific issue.

                          For the browser client, we use javascript to send out request from browser, I believe this is a matter that this javascript isn't compatible with Chrome so that the request isn't sent out correctly.

                           

                          Anyway, we've already raised a ticket for this issue internally.

                           

                          Freeman

                          • 10. Re: examples-cxf-osgi problem...
                            dead_devil_66

                            Greetings ffang.

                             

                            I mean that running inside eclipse and using "mvn compile exec:java" i get the desired result. So, i can say that i can run the java code client.

                            • 11. Re: examples-cxf-osgi problem...
                              ffang

                              Hi,

                               

                              Google a bit, this is caused by chrome by default enable CORS (Cross-Origin Resource Sharing) , and as our client.html is loaded from file:///, then the request to a http:// is across the domain which is not allowed.

                               

                              You could  start chrome like

                              chrome --disable-web-security

                              to  allow for cross-domain requests, and ensure this chrome browser are only used for your example test, as it might cause security issues.

                               

                              Freeman