2 Replies Latest reply on Feb 18, 2009 10:03 AM by roberto rojas

    java.lang.ClassNotFoundException with Camel JMS Component FUSE ESB 4.0.0.3

    roberto rojas Newbie

      Hi There,

       

      I'm trying get a simple route from a file to a queue using the Camel JMS component and I'm getting the exception below.

      Here is the sample route:

       

      <camel:camelContext>

      <camel:route>

       

      <camel:from uri="file:data-in" />

      <camel:to uri="activemq:queue:data-queue"/>

       

       

       

      </camel:route>

      </camel:camelContext> 

       

      <camel:camelContext>

      <bean id="activemq" class="org.apache.camel.component.jms.JmsComponent">

      <property name="connectionFactory">

      <springdm-osgi:reference interface="javax.jms.ConnectionFactory" timeout="5000" />

      </property>

      </bean>

       

       

       

       

       

       

      I added the org.springframework.core package in the Import section of the maven-bundle-plugin and it didn't help much.

      The headers of the bundle show the package is being requested for import, but for some reason the class is not being found.

       

       

      Import-Package = javax.jms;version="1.1",org.apache.camel;version="1.5.1.fuse",org.apache.camel.component.jms;version="1.5.1.fuse",org.apache.camel.component.velocity;version="1.5.1.fuse",org.apache.camel.osgi,org.apache.commons.logging,org.springframework.beans.factory.config;version="2.5",org.springframework.core;version="2.5"

       

       

       

       

      Any help would be greatly appreciated.

       

      Here is the exception:

       

      java.lang.NoClassDefFoundError: org/springframework/core/NamedThreadLocal

      at org.springframework.jms.connection.ConnectionFactoryUtils.doGetTransactionalSession(ConnectionFactoryUtils.java:251)

      at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:458)

      at org.springframework.jms.core.JmsTemplate.send(JmsTemplate.java:548)

      at org.apache.camel.component.jms.JmsProducer.process(JmsProducer.java:227)

      at org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:43)

      at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:75)

      at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68)

      at org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:173)

      at org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:94)

      at org.apache.camel.processor.Pipeline.process(Pipeline.java:115)

      at org.apache.camel.processor.Pipeline.process(Pipeline.java:89)

      at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68)

      at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:52)

      at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:41)

      at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:66)

       

       

       

      Thanks in advance,

       

       

       

      • Roberto

       

        • 1. Re: java.lang.ClassNotFoundException with Camel JMS Component FUSE ESB 4.0.0.3
          Joe Alex Newbie

          Check out the following http://fusesource.com/issues/browse/ESB-530

          I had a different error though with "Lifecycle" class missing but after the fix the route worked fine with JMS. Also make sure the prerequisite features are installed and the camel.component is in the pom.xml import.

          • 2. Re: java.lang.ClassNotFoundException with Camel JMS Component FUSE ESB 4.0.0.3
            roberto rojas Newbie

            joealex3,

             

            Thanks for the quick reply.

            It turns out that the issue is some sort of mix-up between spring 2.5.5 and 2.5.6 (as pointed out by the link you sent) when the camel-velocity feature is installed from the mvn:org.apache.servicemix.camel/org.apache.servicemix.camel.features/4.0.0.3-fuse/xml/features before the camel-jms(1.5.1) is installed. 

             

            Reversing the order fixes the problem:

            • osgi install -s mvn:org.apache.camel/camel-jms/1.5.1.0-fuse

            • features addUrl mvn:org.apache.servicemix.camel/org.apache.servicemix.camel.features/4.0.0.3-fuse/xml/features

            • features install camel-velocity

             

            Before I was following the steps like this and that caused the problem:

             

            • features addUrl mvn:org.apache.servicemix.camel/org.apache.servicemix.camel.features/4.0.0.3-fuse/xml/features

            • features install camel-velocity

            • osgi install -s mvn:org.apache.camel/camel-jms/1.5.1.0-fuse

             

             

             

             

             

             

             

             

            Thanks,

             

             

             

             

             

            • Roberto