2 Replies Latest reply on Apr 19, 2011 8:06 AM by grahamp

    Cannot start multiple web services (jaxws)

    grahamp

      I'm having trouble trying to run two web services in same container (same port, different service name).  Here was first attempt

       

      +++ bundle A +++

       

      (ServerImpl.java:71)

      at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:149)

       

      has anyone else encountered and solved this problem?

       

      Edited by: grahamp on Apr 18, 2011 4:37 PM

        • 1. Re: Cannot start multiple web services (jaxws)
          ffang

          Hi,

          Given the error like

          java.net.MalformedURLException: no protocol: /NumbersOnline

          Ensure your beans.xml for bunde A contain.

           

           

          With address like

          address="http://0.0.0:9090/NumbersOnline"

          you're using cxf http transport, which use jetty directly underlying.

          with address like

          address="/NumbersOnline"

          you're using cxf http-osgi transport, which use pax-web(pax-web is on top of jetty also) underlying, it's basically a servlet listening on default port 8181(you can change it through configuration, I guess you already change it to 9090), so you can bind multiple service on this port with different service name, but you need ensure you import correct cxf entension files to load the correct transport.

           

          Freeman

          • 2. Re: Cannot start multiple web services (jaxws)
            grahamp

            Thanks for taking the time to reply, the advice was helpful and got me further.  Now I have the cxf-extension-osgi resource imported instead of the jetty one, I can reliably start both bundles. 

             

            Some trouble accessing the web services until I found you have to put "cxf" into the middle of the url.  It's a shame the log says

             

                             Setting the server's publish address to be /NumbersOnline

             

            when actually the publish address is /cxf/NumbersOnline

             

            Edited by: grahamp on Apr 19, 2011 12:04 PM