-
1. Re: Loader constraint violation
ffang Apr 20, 2011 4:45 AM (in response to manta7)Hi,
Could you elaborate your application?
A few question like
1. is your application a pure camel bundle or a use JBI servicemix-camel component?
2. if it use JBI servicemix-camel component, you you use OSGi package or JBI package?
3. in your bundle do you embed any camel related jars?
Freeman
-
2. Re: Loader constraint violation
manta7 Apr 20, 2011 4:51 AM (in response to ffang)1. It's a servicemix component with a SA project containing multiple SU which one of them is a Camel SU.
2. And I'm just using the JBI style
3. In my project-sa.zip, there is a camel-su.zip which contains in the lib directory a camel-core.jar
-
3. Re: Loader constraint violation
ffang Apr 20, 2011 5:25 AM (in response to manta7)Hi,
3. In my project-sa.zip, there is a camel-su.zip which contains in the lib directory a camel-core.jar
I think this is the problem, as OSGi container already provide this camel-core.jar, that's why you saw classloader conflict issue, one class loaded from the OSGi container camel-core, one from your SU.
This is a trouble when you use JBI package.
You need do a little tricky like
1. mark camel-core dependency in your SU pom.xml as provided scope like
into your SU bean.xml, this can make your SU refer the camel-core bundle jar from osgi container, more details from
I encourage you should use OSGi packaging but not old JBI packaging as now you're working with a OSGi container, with OSGi packaging you needn't package 3rd libs into your own SA, all are shared from the bundles installed in the container.
http://servicemix.apache.org/classloaders.html
Freeman
Edited by: ffang on Apr 20, 2011 9:25 AM
-
4. Re: Loader constraint violation
manta7 Apr 21, 2011 5:10 AM (in response to ffang)Indeed, I passed my project under the OSGI way and it works perfectly
Thanks again