1 Reply Latest reply on Mar 9, 2010 11:30 AM by karypid

    Newbie: What is the "cxf-osgi" __FEATURE__ and how do I use it properly?

      Hi,

       

      I'm trying learn how to build and deploy CXF web services. I've found that the HelloWorld example does not work unless the "cxf-osgi" feature is deployed after it. I can't understand what I'm doing wrong.

       

      IMPORTANT NOTE: as far as I understand, the "cxf-osgi" feature installed with "features:install cxf-osgi" is totally different from the "cxf-osgi" example that exists in the "examples" folder. They're two different things with the same name.

       

      So, what I'm doing is pretty basic:

       

      1) Compile "cxf-osgi" in "examples" folder into "cxf-osgi-4.2.0-fuse-01-00.jar"

      2) Throwing it into the "deploy" folder.

       

      When I go to "http://localhost:8181/cxf" I see a HelloWorld service published at address "Endpoint address: /HelloWorld". Clicking on the link to view the WSDL contract does not work; it takes you to "http://localhost:8181/HelloWorld?wsdl" which comes back with a "NOT_FOUND" page.

       

      Now, if I type the following into the Karaf console AFTER deploying my service:

       

      3) Enter "features:install cxf-osgi"

       

      And everything works!

       

      I go back to "http://localhost:8181/cxf" I see the HelloWorld service published at the proper URL address "Endpoint address: http://localhost:8181/cxf/HelloWorld" and clicking on the link shows the WSDL contract loaded from "http://localhost:8181/cxf/HelloWorld?wsdl".

       

      So what is this "cxf-osgi" feature how am I supposed to use it?

       

      The reason I ask is because at first I though it was some CXF component that is required for CXF services to work, that simply needs to be deployed at startup. However, I found that when the features is already installed while deploying the web service, it still doesn't work. So, doing:

       

      1) features:install cxf-osgi

      2) Compile "cxf-osgi" in "examples" folder into "cxf-osgi-4.2.0-fuse-01-00.jar"

      3) Throw it into the "deploy" folder.

       

      Does not work, it exhibits the same problem. I must install the "cxf-osgi" feature only AFTER my bundle is deployed with:

       

      4) features:uninstall cxf-osgi

      5) features:install cxf-osgi

       

      Everything works again.