Charles, If you are running this with Felix as the underlying OSGi runtime (check the karaf.framework property in the etc/config.properties file), you can add felix.log.level=4 to the same file to get more verbose osgi wiring information, but also, more importantly, a more precise exception that explains which import is missing from what bundle exactly.
I suspect there might be a problem with a version mismatch on Camel somehow here. The activemq-camel 5.3.0 bundle is a release version so it don't think it would have a dependency on the 2.1-SNAPSHOT of Camel. In fact, if I install that bundle here it seems to import org.apache.camel;version:=[2.0,2.1). However, since they're all optional imports you might have the bundle installed without being wired to anything at all. Could you do a packages:imports on the activemq-camel bundle? Regards, Gert Vanthienen ------------------------ Open Source SOA: http://fusesource.com Blog: http://gertvanthienen.blogspot.com/ 2009/11/17 Charles Moulliard <[email protected]>: > When deploying a camel route top of ServiceMix 4, I have a class > loading issue. By looking to the class exported/imported from the > different bundles, evrything seems ok. So where is the ikssue ? > > 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> > > Regards, > > 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 >
