You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Mark <ja...@gmail.com> on 2010/08/09 00:46:51 UTC
Camel 2.4.0 NoClassDefFoundError org/springframework/context/SmartLifecycle
/ appears in camel in action too.
To reproduce:
mvn archetype:generate -DarchetypeGroupId=org.apache.camel.archetypes \
-DarchetypeArtifactId=camel-archetype-activemq -DarchetypeVersion=2.4.0 \
-DgroupId=myGroupId -DartifactId=myArtifactId
mvn clean camel:run
...
Failed properties: Property 'brokerURL' threw exception; nested
exception is java.lang.NoClassDefFoundError:
org/springframework/context/SmartLifecycle
...
If you change the camel version property to 2.3.0 in pom then run:
mvn clean camel:run
It works.
What;s strange is that org/springframework/context/SmartLifecycle is
on the classpath, as it's provided by
I tried to explicitly provide the class:
<plugin>
<groupId>org.apache.camel</groupId>
<artifactId>camel-maven-plugin</artifactId>
<version>${camel-version}</version>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>3.0.3.RELEASE</version>
</dependency>
</dependencies>
</plugin>
Still no joy;
I have also seen this issues with the examples for camel in action.
Any ideas / can someone else confirm?
Kind Regards
Mark
Re: Camel 2.4.0 NoClassDefFoundError org/springframework/context/SmartLifecycle
/ appears in camel in action too.
Posted by Mark <ja...@gmail.com>.
That fixed it:
I didn't think of that since
org.springframework:spring-context:jar:3.0.3.RELEASE
Maybe the archetype needs fixing :(
-DarchetypeArtifactId=camel-archetype-activemq -DarchetypeVersion=2.4.0
I was trying to work arround this problem this moring, by running the
main class:
org.apache.camel.spring.Main
However this ended up giving me:
Caused by: java.lang.ClassNotFoundException: com.sun.xml.bind.v2.ContextFactory
Again strange since the JAXB Api and Impl are both on the classpath
Any ideas on this one?
Bellow is the dependecy tree(s) for both the before and after fix:
[INFO] Searching repository for plugin with prefix: 'dependency'.
[INFO] ------------------------------------------------------------------------
[INFO] Building Unnamed - com.js.ex:camel-spring-ex05:jar:0.0.1-SNAPSHOT
[INFO] task-segment: [dependency:tree]
[INFO] ------------------------------------------------------------------------
[INFO] [dependency:tree {execution: default-cli}]
[INFO] com.js.ex:camel-spring-ex05:jar:0.0.1-SNAPSHOT
[INFO] +- org.apache.activemq:activemq-core:jar:5.3.2:compile
[INFO] | +- commons-logging:commons-logging-api:jar:1.1:compile
[INFO] | +- org.apache.geronimo.specs:geronimo-jms_1.1_spec:jar:1.1.1:compile
[INFO] | +- org.apache.activemq:activeio-core:jar:3.1.2:compile
[INFO] | | \-
org.apache.geronimo.specs:geronimo-j2ee-management_1.1_spec:jar:1.0.1:compile
[INFO] | +- org.apache.activemq:kahadb:jar:5.3.2:compile
[INFO] | +- org.apache.activemq.protobuf:activemq-protobuf:jar:1.0:compile
[INFO] | +- org.osgi:org.osgi.core:jar:4.1.0:compile
[INFO] | +- org.springframework.osgi:spring-osgi-core:jar:1.2.1:compile
[INFO] | | \- org.springframework.osgi:spring-osgi-io:jar:1.2.1:compile
[INFO] | +- org.apache.geronimo.specs:geronimo-j2ee-management_1.0_spec:jar:1.0:compile
[INFO] | +- org.springframework:spring-context:jar:2.5.6:compile
[INFO] | | \- aopalliance:aopalliance:jar:1.0:compile
[INFO] | \- commons-net:commons-net:jar:2.0:compile
[INFO] +- org.apache.activemq:activemq-camel:jar:5.3.2:compile
[INFO] | \- org.apache.activemq:activemq-pool:jar:5.3.2:compile
[INFO] | +-
org.apache.geronimo.specs:geronimo-jta_1.0.1B_spec:jar:1.0.1:compile
[INFO] | \- commons-pool:commons-pool:jar:1.5.4:compile
[INFO] +- org.apache.camel:camel-core:jar:2.4.0:compile
[INFO] | +- org.fusesource.commonman:commons-management:jar:1.0:compile
[INFO] | \- com.sun:tools:jar:1.5.0:system
[INFO] +- org.apache.camel:camel-jms:jar:2.4.0:compile
[INFO] | +- org.springframework:spring-jms:jar:3.0.3.RELEASE:compile
[INFO] | +- org.springframework:spring-core:jar:3.0.3.RELEASE:compile
[INFO] | | \- org.springframework:spring-asm:jar:3.0.3.RELEASE:compile
[INFO] | +- org.springframework:spring-tx:jar:3.0.3.RELEASE:compile
[INFO] | \- org.springframework:spring-beans:jar:3.0.3.RELEASE:compile
[INFO] +- org.apache.camel:camel-spring:jar:2.4.0:compile
[INFO] | \- org.springframework:spring-aop:jar:3.0.3.RELEASE:compile
[INFO] +- org.apache.xbean:xbean-spring:jar:3.5:compile
[INFO] | \- commons-logging:commons-logging:jar:1.0.3:compile
[INFO] +- log4j:log4j:jar:1.2.16:compile
[INFO] +- javax.xml.bind:jaxb-api:jar:2.1:compile
[INFO] | +- javax.xml.stream:stax-api:jar:1.0-2:compile
[INFO] | \- javax.activation:activation:jar:1.1:compile
[INFO] +- com.sun.xml.bind:jaxb-impl:jar:2.1.2:compile
[INFO] \- junit:junit:jar:4.7:test
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3 seconds
[INFO] Finished at: Mon Aug 09 09:47:25 BST 2010
[INFO] Final Memory: 19M/762M
[INFO] ------------------------------------------------------------------------
After:
[INFO] Searching repository for plugin with prefix: 'dependency'.
[INFO] ------------------------------------------------------------------------
[INFO] Building Unnamed - com.js.ex:camel-spring-ex05:jar:0.0.1-SNAPSHOT
[INFO] task-segment: [dependency:tree]
[INFO] ------------------------------------------------------------------------
[INFO] [dependency:tree {execution: default-cli}]
[INFO] com.js.ex:camel-spring-ex05:jar:0.0.1-SNAPSHOT
[INFO] +- org.apache.activemq:activemq-core:jar:5.3.2:compile
[INFO] | +- commons-logging:commons-logging-api:jar:1.1:compile
[INFO] | +- org.apache.geronimo.specs:geronimo-jms_1.1_spec:jar:1.1.1:compile
[INFO] | +- org.apache.activemq:activeio-core:jar:3.1.2:compile
[INFO] | | \-
org.apache.geronimo.specs:geronimo-j2ee-management_1.1_spec:jar:1.0.1:compile
[INFO] | +- org.apache.activemq:kahadb:jar:5.3.2:compile
[INFO] | +- org.apache.activemq.protobuf:activemq-protobuf:jar:1.0:compile
[INFO] | +- org.osgi:org.osgi.core:jar:4.1.0:compile
[INFO] | +- org.springframework.osgi:spring-osgi-core:jar:1.2.1:compile
[INFO] | | \- org.springframework.osgi:spring-osgi-io:jar:1.2.1:compile
[INFO] | +- org.apache.geronimo.specs:geronimo-j2ee-management_1.0_spec:jar:1.0:compile
[INFO] | \- commons-net:commons-net:jar:2.0:compile
[INFO] +- org.springframework:spring-context:jar:3.0.3.RELEASE:compile
[INFO] | +- org.springframework:spring-aop:jar:3.0.3.RELEASE:compile
[INFO] | | \- aopalliance:aopalliance:jar:1.0:compile
[INFO] | +- org.springframework:spring-beans:jar:3.0.3.RELEASE:compile
[INFO] | +- org.springframework:spring-core:jar:3.0.3.RELEASE:compile
[INFO] | +- org.springframework:spring-expression:jar:3.0.3.RELEASE:compile
[INFO] | \- org.springframework:spring-asm:jar:3.0.3.RELEASE:compile
[INFO] +- org.apache.activemq:activemq-camel:jar:5.3.2:compile
[INFO] | \- org.apache.activemq:activemq-pool:jar:5.3.2:compile
[INFO] | +-
org.apache.geronimo.specs:geronimo-jta_1.0.1B_spec:jar:1.0.1:compile
[INFO] | \- commons-pool:commons-pool:jar:1.5.4:compile
[INFO] +- org.apache.camel:camel-core:jar:2.4.0:compile
[INFO] | +- org.fusesource.commonman:commons-management:jar:1.0:compile
[INFO] | \- com.sun:tools:jar:1.5.0:system
[INFO] +- org.apache.camel:camel-jms:jar:2.4.0:compile
[INFO] | +- org.springframework:spring-jms:jar:3.0.3.RELEASE:compile
[INFO] | \- org.springframework:spring-tx:jar:3.0.3.RELEASE:compile
[INFO] +- org.apache.camel:camel-spring:jar:2.4.0:compile
[INFO] +- org.apache.xbean:xbean-spring:jar:3.5:compile
[INFO] | \- commons-logging:commons-logging:jar:1.0.3:compile
[INFO] +- log4j:log4j:jar:1.2.16:compile
[INFO] +- javax.xml.bind:jaxb-api:jar:2.1:compile
[INFO] | +- javax.xml.stream:stax-api:jar:1.0-2:compile
[INFO] | \- javax.activation:activation:jar:1.1:compile
[INFO] +- com.sun.xml.bind:jaxb-impl:jar:2.1.2:compile
[INFO] \- junit:junit:jar:4.7:test
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3 seconds
[INFO] Finished at: Mon Aug 09 09:43:11 BST 2010
[INFO] Final Memory: 19M/762M
[INFO] ------------------------------------------------------------------------
On 9 August 2010 09:13, Willem Jiang <wi...@gmail.com> wrote:
> In Camel 2.4.0 we switch to Spring 3.0.0RELEASE, and ActiveMQ-core is using
> spring context 2.5.6.
> So you need to add dependency of spring-context 3.0.3 into to pom, not the
> camel-maven-plugin to override it.
>
> Willem
> ----------------------------------
> Apache Camel, Apache CXF committer
> Open Source Integration http://www.fusesource.com
> Blog http://willemjiang.blogspot.com
> Tiwtter http://twitter.com/willemjiang
>
> Mark wrote:
>>
>> To reproduce:
>>
>> mvn archetype:generate -DarchetypeGroupId=org.apache.camel.archetypes \
>> -DarchetypeArtifactId=camel-archetype-activemq -DarchetypeVersion=2.4.0 \
>> -DgroupId=myGroupId -DartifactId=myArtifactId
>>
>> mvn clean camel:run
>> ...
>> Failed properties: Property 'brokerURL' threw exception; nested
>> exception is java.lang.NoClassDefFoundError:
>> org/springframework/context/SmartLifecycle
>> ...
>>
>> If you change the camel version property to 2.3.0 in pom then run:
>>
>> mvn clean camel:run
>>
>> It works.
>>
>> What;s strange is that org/springframework/context/SmartLifecycle is
>> on the classpath, as it's provided by
>>
>> I tried to explicitly provide the class:
>>
>> <plugin>
>> <groupId>org.apache.camel</groupId>
>> <artifactId>camel-maven-plugin</artifactId>
>> <version>${camel-version}</version>
>> <dependencies>
>> <dependency>
>>
>> <groupId>org.springframework</groupId>
>>
>> <artifactId>spring-context</artifactId>
>>
>> <version>3.0.3.RELEASE</version>
>> </dependency>
>> </dependencies>
>> </plugin>
>>
>>
>> Still no joy;
>>
>> I have also seen this issues with the examples for camel in action.
>>
>> Any ideas / can someone else confirm?
>>
>> Kind Regards
>>
>> Mark
>>
>
>
Re: Camel 2.4.0 NoClassDefFoundError org/springframework/context/SmartLifecycle
/ appears in camel in action too.
Posted by Willem Jiang <wi...@gmail.com>.
In Camel 2.4.0 we switch to Spring 3.0.0RELEASE, and ActiveMQ-core is
using spring context 2.5.6.
So you need to add dependency of spring-context 3.0.3 into to pom, not
the camel-maven-plugin to override it.
Willem
----------------------------------
Apache Camel, Apache CXF committer
Open Source Integration http://www.fusesource.com
Blog http://willemjiang.blogspot.com
Tiwtter http://twitter.com/willemjiang
Mark wrote:
> To reproduce:
>
> mvn archetype:generate -DarchetypeGroupId=org.apache.camel.archetypes \
> -DarchetypeArtifactId=camel-archetype-activemq -DarchetypeVersion=2.4.0 \
> -DgroupId=myGroupId -DartifactId=myArtifactId
>
> mvn clean camel:run
> ...
> Failed properties: Property 'brokerURL' threw exception; nested
> exception is java.lang.NoClassDefFoundError:
> org/springframework/context/SmartLifecycle
> ...
>
> If you change the camel version property to 2.3.0 in pom then run:
>
> mvn clean camel:run
>
> It works.
>
> What;s strange is that org/springframework/context/SmartLifecycle is
> on the classpath, as it's provided by
>
> I tried to explicitly provide the class:
>
> <plugin>
> <groupId>org.apache.camel</groupId>
> <artifactId>camel-maven-plugin</artifactId>
> <version>${camel-version}</version>
> <dependencies>
> <dependency>
> <groupId>org.springframework</groupId>
> <artifactId>spring-context</artifactId>
> <version>3.0.3.RELEASE</version>
> </dependency>
> </dependencies>
> </plugin>
>
>
> Still no joy;
>
> I have also seen this issues with the examples for camel in action.
>
> Any ideas / can someone else confirm?
>
> Kind Regards
>
> Mark
>