3 Replies Latest reply on Nov 6, 2008 9:41 AM by Scott England-Sullivan

    Fuse 4 + Camel + JMS + OSGI

    Miere L. Teixeira Newbie

      Hi friends.

       

      I've been working with Fuse 3.3 and now migrating to Fuse 4. After some time playing with Camel, now I'm trying JMS queue and Camel flows, but I can't to deploy it as OSGI package on Fuse/Servicemix4.

       

      Attached is the project source.

       

      You can test my project with maven:

       

      $ unzip -x first.zip && cd first

      $ mvn clean install

       

      and at Servicemix Console:

      servicemix> osgi install file:///first/target/first1.0.jar

      PS: this is just a sample File URL, check before run this.

       

      Below follows my Servicemix Log.

       

      Thanks.

       

      16:24:06,738 | ERROR | xtenderThread-61 | OsgiBundleXmlApplicationContext  | gatedExecutionApplicationContext  240 | Pre refresh error

      org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'camelContext:beanPostProcessor': Cannot resolve reference to bean 'camelContext' while setting bean property 'camelContext'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'camelContext': Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/apache/camel/component/jms/JmsComponent

           at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:275)

           at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:104)

           at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1245)

           at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)

           at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)

           at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)

           at java.security.AccessController.doPrivileged(Native Method)

           at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)

           at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)

           at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:221)

           at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)

           at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)

           at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)

           at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:881)

           at org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:606)

           at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.startRefresh(AbstractDelegatedExecutionApplicationContext.java:226)

           at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.stageOne(DependencyWaiterApplicationContextExecutor.java:221)

           at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.refresh(DependencyWaiterApplicationContextExecutor.java:172)

           at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.refresh(AbstractDelegatedExecutionApplicationContext.java:136)

           at org.springframework.osgi.extender.internal.activator.ContextLoaderListener$2.run(ContextLoaderListener.java:746)

           at java.lang.Thread.run(Thread.java:619)

      Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'camelContext': Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/apache/camel/component/jms/JmsComponent

           at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1337)

           at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)

           at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)

           at java.security.AccessController.doPrivileged(Native Method)

           at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)

           at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)

           at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:221)

           at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)

           at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)

           at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)

           at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:269)

           ... 20 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.searchpolicy.ContentClassLoader.findClass(ContentClassLoader.java:214)

           at org.apache.felix.framework.searchpolicy.ContentClassLoader.loadClassFromModule(ContentClassLoader.java:85)

           at org.apache.felix.framework.searchpolicy.ContentLoaderImpl.getClass(ContentLoaderImpl.java:162)

           at org.apache.felix.framework.searchpolicy.R4Wire.getClass(R4Wire.java:101)

           at org.apache.felix.framework.searchpolicy.R4SearchPolicyCore.searchImports(R4SearchPolicyCore.java:505)

           at org.apache.felix.framework.searchpolicy.R4SearchPolicyCore.findClassOrResource(R4SearchPolicyCore.java:466)

           at org.apache.felix.framework.searchpolicy.R4SearchPolicyCore.findClass(R4SearchPolicyCore.java:185)

           at org.apache.felix.framework.searchpolicy.R4SearchPolicy.findClass(R4SearchPolicy.java:45)

           at org.apache.felix.framework.searchpolicy.ContentClassLoader.loadClass(ContentClassLoader.java:109)

           at java.lang.ClassLoader.loadClass(ClassLoader.java:252)

           at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)

           at ecm.integration.sample1.First.configure(First.java:31)

           at org.apache.camel.builder.RouteBuilder.checkInitialized(RouteBuilder.java:190)

           at org.apache.camel.builder.RouteBuilder.getRouteList(RouteBuilder.java:164)

           at org.apache.camel.impl.DefaultCamelContext.addRoutes(DefaultCamelContext.java:401)

           at org.apache.camel.spring.CamelContextFactoryBean.installRoutes(CamelContextFactoryBean.java:503)

           at org.apache.camel.spring.CamelContextFactoryBean.afterPropertiesSet(CamelContextFactoryBean.java:254)

           at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1368)

           at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1334)

           ... 30 more

      Caused by: java.lang.ClassNotFoundException: org.apache.camel.component.jms.JmsComponent

           at org.apache.felix.framework.searchpolicy.R4SearchPolicyCore.findClass(R4SearchPolicyCore.java:198)

           at org.apache.felix.framework.searchpolicy.R4SearchPolicy.findClass(R4SearchPolicy.java:45)

           at org.apache.felix.framework.searchpolicy.ContentClassLoader.loadClass(ContentClassLoader.java:109)

           at java.lang.ClassLoader.loadClass(ClassLoader.java:252)

           at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)

           ... 51 more

      Caused by: java.lang.ClassNotFoundException: org.apache.camel.component.jms.JmsComponent

           at org.apache.felix.framework.searchpolicy.R4SearchPolicyCore.findClassOrResource(R4SearchPolicyCore.java:486)

           at org.apache.felix.framework.searchpolicy.R4SearchPolicyCore.findClass(R4SearchPolicyCore.java:185)

           ... 55 more

      16:24:06,740 | ERROR | xtenderThread-61 | WaiterApplicationContextExecutor | WaiterApplicationContextExecutor  399 | Unable to create application context for , unsatisfied dependencies: none

      org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'camelContext:beanPostProcessor': Cannot resolve reference to bean 'camelContext' while setting bean property 'camelContext'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'camelContext': Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/apache/camel/component/jms/JmsComponent

           at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:275)

           at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:104)

           at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1245)

           at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)

           at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)

           at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)

           at java.security.AccessController.doPrivileged(Native Method)

           at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)

           at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)

           at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:221)

           at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)

           at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)

           at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)

           at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:881)

           at org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:606)

           at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.startRefresh(AbstractDelegatedExecutionApplicationContext.java:226)

           at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.stageOne(DependencyWaiterApplicationContextExecutor.java:221)

           at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.refresh(DependencyWaiterApplicationContextExecutor.java:172)

           at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.refresh(AbstractDelegatedExecutionApplicationContext.java:136)

           at org.springframework.osgi.extender.internal.activator.ContextLoaderListener$2.run(ContextLoaderListener.java:746)

           at java.lang.Thread.run(Thread.java:619)

      Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'camelContext': Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/apache/camel/component/jms/JmsComponent

           at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1337)

           at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)

           at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)

           at java.security.AccessController.doPrivileged(Native Method)

           at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)

           at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)

           at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:221)

           at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)

           at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)

           at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)

           at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:269)

           ... 20 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.searchpolicy.ContentClassLoader.findClass(ContentClassLoader.java:214)

           at org.apache.felix.framework.searchpolicy.ContentClassLoader.loadClassFromModule(ContentClassLoader.java:85)

           at org.apache.felix.framework.searchpolicy.ContentLoaderImpl.getClass(ContentLoaderImpl.java:162)

           at org.apache.felix.framework.searchpolicy.R4Wire.getClass(R4Wire.java:101)

           at org.apache.felix.framework.searchpolicy.R4SearchPolicyCore.searchImports(R4SearchPolicyCore.java:505)

           at org.apache.felix.framework.searchpolicy.R4SearchPolicyCore.findClassOrResource(R4SearchPolicyCore.java:466)

           at org.apache.felix.framework.searchpolicy.R4SearchPolicyCore.findClass(R4SearchPolicyCore.java:185)

           at org.apache.felix.framework.searchpolicy.R4SearchPolicy.findClass(R4SearchPolicy.java:45)

           at org.apache.felix.framework.searchpolicy.ContentClassLoader.loadClass(ContentClassLoader.java:109)

           at java.lang.ClassLoader.loadClass(ClassLoader.java:252)

           at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)

           at ecm.integration.sample1.First.configure(First.java:31)

           at org.apache.camel.builder.RouteBuilder.checkInitialized(RouteBuilder.java:190)

           at org.apache.camel.builder.RouteBuilder.getRouteList(RouteBuilder.java:164)

           at org.apache.camel.impl.DefaultCamelContext.addRoutes(DefaultCamelContext.java:401)

           at org.apache.camel.spring.CamelContextFactoryBean.installRoutes(CamelContextFactoryBean.java:503)

           at org.apache.camel.spring.CamelContextFactoryBean.afterPropertiesSet(CamelContextFactoryBean.java:254)

           at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1368)

           at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1334)

           ... 30 more

      Caused by: java.lang.ClassNotFoundException: org.apache.camel.component.jms.JmsComponent

           at org.apache.felix.framework.searchpolicy.R4SearchPolicyCore.findClass(R4SearchPolicyCore.java:198)

           at org.apache.felix.framework.searchpolicy.R4SearchPolicy.findClass(R4SearchPolicy.java:45)

           at org.apache.felix.framework.searchpolicy.ContentClassLoader.loadClass(ContentClassLoader.java:109)

           at java.lang.ClassLoader.loadClass(ClassLoader.java:252)

           at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)

           ... 51 more

      Caused by: java.lang.ClassNotFoundException: org.apache.camel.component.jms.JmsComponent

           at org.apache.felix.framework.searchpolicy.R4SearchPolicyCore.findClassOrResource(R4SearchPolicyCore.java:486)

           at org.apache.felix.framework.searchpolicy.R4SearchPolicyCore.findClass(R4SearchPolicyCore.java:185)

           ... 55 more