Search code examples
javaapache-camelosgiapache-karafapache-servicemix

Camel - unmarshal().serialization() - ClassNotFoundException


I'm trying to unmarshal with serialization method a bean that is not the current bundle but in a commons components bundle.

I get the following error when camel tries to unmarshal my bean :

22:43:11,865 | ERROR | nModule-thread-1 | DefaultErrorHandler | 89 - org.apache.camel.camel-core - 2.8.0.fuse-06-11 | Failed delivery for exchangeId: ID-ITEM-64684-49962-1354223882336-2-1. Exhausted after delivery attempt: 1 caught: java.lang.ClassNotFoundException: commons.InformationInput java.lang.ClassNotFoundException: commons.InformationInput at java.net.URLClassLoader$1.run(URLClassLoader.java:202)[:1.6.0_33] at java.security.AccessController.doPrivileged(Native Method)[:1.6.0_33] at java.net.URLClassLoader.findClass(URLClassLoader.java:190)[:1.6.0_33] at java.lang.ClassLoader.loadClass(ClassLoader.java:306)[:1.6.0_33]http://stackoverflow.com/questions/6749334/osgi-bundle-access-spring-context-file-from-another-bundle at java.lang.ClassLoader.loadClass(ClassLoader.java:247)[:1.6.0_33] at org.apache.felix.framework.ModuleImpl.doImplicitBootDelegation(ModuleImpl.java:1610) at org.apache.felix.framework.ModuleImpl.searchDynamicImports(ModuleImpl.java:1547)

My bundle containing the bean is correctly started and i've defined the commons package in the Export-Package of the bundle definition

Does anyone managed to such thing ?


Solution

  • I find a workaroud by enabling dynamicimport on camel-core bundle. This can be done on karaf console : dev:dynamicimport <camel-core-bundle-id>