-
1. Re: Fuse ESB 4.4 - Camel-CXF deployment problem
ffang Aug 7, 2011 10:40 PM (in response to drpal001)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 Jan 5, 2012 4:39 AM (in response to ffang)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 Jan 5, 2012 4:15 AM (in response to xiaoqiu)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 Jan 5, 2012 6:21 AM (in response to ffang)Thank you for you reply.I did ,it run well.
The right camel-context.xml is :
Hope it will help others!