4 Replies Latest reply on Mar 21, 2011 8:55 PM by Freeman(Yue) Fang

    features.xml for CXF question

    atlantix Newbie

      Hi All-

       

      My question is a general order,

       

      I want to have a Client to a webservice running in an OSGi container,

      I could have used the full apache-servicemix-4.3.1-fuse-00-00 ...

       

      I wanted to have a very light and small version ,

      I think I will only need Felix ( just to run OSGi container ) I chosed to have install Karaf  and since my OSGi bundle require to invoke a webservice I developed a small one

       

      org.apache.cxf.jaxws.JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();

                factory.setServiceClass(MyService.class);

                factory.setAddress("http://localhost:8181/cxf/service");

                MyService myService = (MyService)factory.create();

       

      The question is how do I know which features I need to add to My basic Karaf installation  and how can I do that

       

      Thanks

        • 1. Re: features.xml for CXF question
          Freeman(Yue) Fang Master

          Hi,

           

          Take a look at the cxf feature defined in

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

           

          The bundles list in that feature is pretty much what you need.

          You can write your own features file which contain the cxf feature I point you, then use

          features:addUrl to make this feature available in your karaf container, then just use

          features:install cxf.

           

          Freeman

          • 2. Re: features.xml for CXF question
            atlantix Newbie

            Thanks for the answer ,

             

            I created a custom xml file just by copying the cxf feature section from the original file you stated, then I added the url to the features list

            When I tried features:install cxf I fell into the following error

             

            karaf@root> features:install  cxf

            Error executing command: Could not start bundle mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.saaj-impl/1.

            2_2 in feature(s) cxf-2.3.2-fuse-00-00: Unresolved constraint in bundle org.apache.servicemix.bundles.saaj-impl : Unablto resolve 146.0: missing requirement package; (package=com.sun.org.apache.xerces.internal.dom)

             

             

            and I had the following error

            karaf@root> features:install  cxf

            Error executing command: Could not start bundle mvn:org.apache.cxf/cxf-bundle/2.3.2-fuse-00-00 in feature(s) cxf-2.3.2-fuse-00

            -00: Unresolved constraint in bundle org.apache.cxf.bundle : Unable to resolve 623.0: missing requirement package

            ; (package=javax.transaction.xa)

            • 3. Re: features.xml for CXF question
              Willem Jiang Master

              Hi,

               

              You can not install the CXF feature in a pure Karaf kit, here is a JIRA KARAF-245[1] can help you to work around that issue.

               

              https://issues.apache.org/jira/browse/KARAF-245

               

              Willem

              • 4. Re: features.xml for CXF question
                Freeman(Yue) Fang Master

                Hi,

                 

                If you diff the jre.properties files between the one shipped with ESB and karaf, you can see the difference.

                Both com.sun.org.apache.xerces.internal.dom and javax.transaction.xa are exported by jre in ESB, but it's not exported by jre in karaf.

                 

                We adapt karaf to make sure cxf, camel, activemq can work together on top of it.

                 

                You need change your jre.properties in karaf accordingly.

                 

                I'd say instead of add feature/package in karaf, you'd better remove unnecessary features in ESB, it would be much easier for you I guess.

                You can edit etc/org.apache.karaf.features.cfg to remove unnecessary feature there.

                 

                Freeman