4 Replies Latest reply on Jan 5, 2012 6:21 AM by xiaoqiu

    Fuse ESB 4.4 - Camel-CXF deployment problem

    drpal001

      Hi,

      I have a camel route that invokes a web service endpoint using CXF component with HTTP protocol. My camel-context.xml file looks like:

       

       

      <!<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml"/>>

      <!<import resource="classpath:META-INF/cxf/cxf-extension-http-jetty.xml"/>>

       

         

           at org.apache.servicemix.common.ManagementSupport.failure(ManagementSupport.java:46)[149:servicemix-common:2011.02.0.fuse-00-43]

           at org.apache.servicemix.common.AbstractDeployer.failure(AbstractDeployer.java:43)[149:servicemix-common:2011.02.0.fuse-00-43]

           at org.apache.servicemix.common.xbean.AbstractXBeanDeployer.deploy(AbstractXBeanDeployer.java:116)[149:servicemix-common:2011.02.0.fuse-00-43]

           at org.apache.servicemix.camel.CamelSpringDeployer.deploy(CamelSpringDeployer.java:76)[187:servicemix-camel:2011.02.0.fuse-00-43]

           at org.apache.servicemix.common.BaseServiceUnitManager.doDeploy(BaseServiceUnitManager.java:86)[149:servicemix-common:2011.02.0.fuse-00-43]

           at org.apache.servicemix.common.BaseServiceUnitManager.deploy(BaseServiceUnitManager.java:69)[149:servicemix-common:2011.02.0.fuse-00-43]

           at org.apache.servicemix.jbi.deployer.artifacts.ServiceUnitImpl.deploy(ServiceUnitImpl.java:104)[145:org.apache.servicemix.jbi.deployer:1.5.0.fuse-00-43]

           at org.apache.servicemix.jbi.deployer.impl.ServiceAssemblyInstaller.deploySUs(ServiceAssemblyInstaller.java:207)[145:org.apache.servicemix.jbi.deployer:1.5.0.fuse-00-43]

           ... 14 more

       

      Any help in resolving the problem would be greatly appreciated.

       

      Thanks in advance!

        • 1. Re: Fuse ESB 4.4 - Camel-CXF deployment problem
          ffang

          Hi,

           

          This error

          <loc-message>Error creating bean with name 'myCamel:beanPostProcessor': Initialization of bean failed; nested exception is java.lang.ClassCastException: org.apache.cxf.bus.resource.ResourceManagerImpl cannot be cast to org.apache.cxf.resource.ResourceManager</loc-message>

          generally means class ResourceManagerImpl and ResourceManager are loaded by different classloaders.

          You mentioned that you're using JBI service assembly packaging, you need ensure that your SA doesn't contain any cxf libs, if should refer cxf related class from pre-installed cxf bundle if necessary, take a look at , "New in ServiceMix 4.2.0" to get more details.

           

          More over, if your camel router doesn't use any JBI endpoint, I suggest you needn't use JBI service assembly packaging at all, just build camel router as a normal OSGi bundle is more straightforward.

          http://servicemix.apache.org/classloaders.html

           

          Freeman

          • 2. Re: Fuse ESB 4.4 - Camel-CXF deployment problem
            xiaoqiu

            hello.I had the same question and did the operation following your method,but the question wen't resolved.

             

            Edited by: xiaoqiu on Jan 5, 2012 5:38 PM

            • 3. Re: Fuse ESB 4.4 - Camel-CXF deployment problem
              ffang

              Hi,

               

              From your test project I can't see you follow my suggestion,  you use JBI package for SA, but you didn't set classpath to refer pre-installed bundles in xbean.xml, I do suggest you take a look at , "New in ServiceMix 4.2.0" to get more details.

              Something like

               

               

               

              You need ensure your SA doesn't embed any cxf jars(you need use provided scope for cxf dependency), it should use  pre-installed cxf-bundle.

              http://servicemix.apache.org/classloaders.html

               

              Freeman

              • 4. Re: Fuse ESB 4.4 - Camel-CXF deployment problem
                xiaoqiu

                Thank you for you reply.I did ,it run well.

                The right camel-context.xml is :

                 

                 

                 

                 

                Hope it will  help others!