Since we're on a major migration process of this website, some component documents here are out of sync right now. In the meantime you may want to look at the early version of the new website
https://camel.apache.org/staging/
We would very much like to receive any feedback on the new site, please join the discussion on the Camel user mailing list.
Since Servicemix3's component has same hierarchies of the class loaders with the J2EE application server, and the components the class loader is separated with the SU's. And Camel has lots of components, we just include the camel-core and camel-spring components in the servicemix-camel by default. When the user want to use other camel component, they always add the camel-xxx component into their SU lib. You may meet an issue of the class cast exception when deploying the same servicemix-camel component SU twice. In this case, when the SU is redeployed, it will create a new deployer which will create an application context with the class loader of servicemix-camel component, and then using the SU's class loader to create a camel context. Note, In Servicemix4's camel component , we will not get that kind of issue , since the OSGi will help us to manage the relationship of the jars. The solution is putting the camel-xxx components and third part jars into servicemix-camel component's lib. You need to check out the servicemix-camel component's pom.xml and recompile the servicemix-camel component by adding the camel-xxx component dependency. Let me take the latest servicemix-camel as an example 1. Checking out the servicemix-camel component's pom svn co http://svn.apache.org/repos/asf/servicemix/components/engines/servicemix-camel/trunk/pom.xml 2. If you need camel-rmi component , you just put the dependency into the pom.xml <dependency> <groupid>org.apache.camel</groupid> <artifactid>camel-rmi</artifactid> <version>${camel-version}</version> </dependency> 3. Running "mvn install" and copy the servicemix-camel-*.zip into the deploy directory 4. Write your servicemix-camel SU, make sure you don't include any camel relates jars into the SU's lib, you can use the <scope>provided</scope> to not packing the artifact. <dependency> <groupid>org.apache.camel</groupid> <artifactid>camel-rmi</artifactid> <version>${camel-version}</version> <scope>provided</scope> </dependency> |