<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.
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
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.
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.
Thank you for you reply.I did ,it run well.
The right camel-context.xml is :
Hope it will help others!