When deploying a spring file top of ServiceMix 4, I have a class loading issue of a Camel class.
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:osgi="http://www.springframework.org/schema/osgi" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/osgi http://www.springframework.org/schema/osgi/spring-osgi.xsd http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd"> <bean id="active-mq" class="org.apache.activemq.camel.component.ActiveMQComponent" /> <osgi:service id="osgiqueuingservice" ref="active-mq" interface="org.apache.camel.Component"/> </beans> By looking to the class exported/imported from the different bundles, everything seems ok. So where is the issue ? last camel snapshot, apache felix karaf ka...@root> Exception in thread "SpringOsgiExtenderThread-14" org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [org .apache.activemq.camel.component.ActiveMQComponent] for bean with name 'active-mq' defined in URL [bundle://143.0:0/META-INF/spring/osgi-queuingservic e.xml]: problem with class file or dependent class; nested exception is java.lang.NoClassDefFoundError: org.apache.activemq.camel.component.ActiveMQCo mponent not found from bundle [Camel Queuing Service (reportincident.queueservice)] at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1144) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:524) at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1177) at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:758) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:422) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$1600(AbstractDelegatedExecutionApplicationCont ext.java:69) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.ja va:355) at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplication Context.java:320) at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(Dependen cyWaiterApplicationContextExecutor.java:136) at java.lang.Thread.run(Thread.java:619) Caused by: java.lang.NoClassDefFoundError: org.apache.activemq.camel.component.ActiveMQComponent not found from bundle [Camel Queuing Service (reporti ncident.queueservice)] at org.springframework.osgi.util.BundleDelegatingClassLoader.findClass(BundleDelegatingClassLoader.java:112) at org.springframework.osgi.util.BundleDelegatingClassLoader.loadClass(BundleDelegatingClassLoader.java:156) at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at org.springframework.util.ClassUtils.forName(ClassUtils.java:211) at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:385) at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1138) ... 11 more Caused by: java.lang.NoClassDefFoundError: org/apache/camel/component/jms/JmsComponent at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:621) at org.apache.felix.framework.ModuleImpl$ModuleClassLoader.findClass(ModuleImpl.java:1787) at org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:682) at org.apache.felix.framework.ModuleImpl.access$100(ModuleImpl.java:60) at org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1650) at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at org.apache.felix.framework.ModuleImpl.getClassByDelegation(ModuleImpl.java:598) at org.apache.felix.framework.searchpolicy.R4Wire.getClass(R4Wire.java:108) at org.apache.felix.framework.ModuleImpl.searchImports(ModuleImpl.java:1364) at org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:677) at org.apache.felix.framework.ModuleImpl.access$100(ModuleImpl.java:60) at org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1650) at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at org.apache.felix.framework.ModuleImpl.getClassByDelegation(ModuleImpl.java:598) at org.apache.felix.framework.Felix.loadBundleClass(Felix.java:1487) at org.apache.felix.framework.BundleImpl.loadClass(BundleImpl.java:897) at org.springframework.osgi.util.BundleDelegatingClassLoader.findClass(BundleDelegatingClassLoader.java:99) ... 16 more Caused by: java.lang.ClassNotFoundException: org.apache.camel.component.jms.JmsComponent at org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:738) at org.apache.felix.framework.ModuleImpl.access$100(ModuleImpl.java:60) at org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1650) at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) ... 34 more headers 14" ka...@root> headers 143 Camel Queuing Service (143) --------------------------- Bnd-LastModified = 1258451443541 Build-Jdk = 1.6.0_16 Built-By = Charlesm Bundle-ManifestVersion = 2 Bundle-Name = Camel Queuing Service Bundle-SymbolicName = reportincident.queueservice Bundle-Version = 1.0.0.SNAPSHOT Created-By = Apache Maven Bundle Plugin DynamicImport-Package = * Import-Package = org.apache.activemq.camel.component,org.apache.camel,org.apache.camel.component,org.apache.camel.component.jms Manifest-Version = 1.0 Spring-Context = *;publish-context:=false;create-asynchronously:=true Tool = Bnd-0.0.255 ka...@root> packages:imports 143 System Bundle (0): com.sun.org.apache.xerces.internal.jaxp; version=0.0.0 System Bundle (0): org.xml.sax; version=0.0.0 Spring Beans (45): org.springframework.beans.factory.xml; version=2.5.6.SEC01 camel-core (54): org.apache.camel.spi; version=2.1.0.SNAPSHOT camel-core (54): org.apache.camel; version=2.1.0.SNAPSHOT camel-spring (57): org.apache.camel.component; version=2.1.0.SNAPSHOT camel-jms (114): org.apache.camel.component.jms; version=2.1.0.SNAPSHOT activemq-camel (115): org.apache.activemq.camel.component; version=5.3.0 activemq-camel (115): META-INF.services.org.apache.camel; version=0.0.0 ka...@root> Charles Moulliard Senior Enterprise Architect Apache Camel Committer ***************************** blog : http://cmoulliard.blogspot.com twitter : http://twitter.com/cmoulliard Linkedlin : http://www.linkedin.com/in/charlesmoulliard Apache Camel Group : http://www.linkedin.com/groups?home=&gid=2447439&trk=anet_ug_hm