I'm just upgrading from Spring 3.0.6 to 3.1 and there seems to be an issue with running it on a Tomcat. Appearently it has a Spring 3.0.6 dependency and will try to use it when started. That however conflicts with my Spring 3.1 app. I get this when trying to deploy via
mvn clean package tomcat:run
as well as when trying to run it in a Tomcat 7 (via Eclipse or by just copying it to the tomcat webapps folder)
What's the solution here? Might upgrading to Maven 3 help? What about the maven Tomcat-plugin? 1.1 is released so far but version 2 seems to be still under development. Does anyone have a pom setup that uses a 2.x version of the tomcat plugin?
(My current error log basicly says this:
java.lang.NoClassDefFoundError: org/springframework/core/annotation/AnnotationAttributes
which appearently is a version conflict between Spring 3.1 and 3.0.x)
I'm quite lost on this one, been trying all day to work my way through the dependency mess in my modules to upgrade them to 3.1, all the tests run and now I can't run it on Tomcat.. :(
edit: my spring dependency tree:
module1:jar:1.0-SNAPSHOT:compile
+- modul2:jar:1.0-SNAPSHOT:compile
| +- module3:jar:1.1-SNAPSHOT:compile
| | +- org.springframework:spring-context:jar:3.1.1.RELEASE:compile
| | +- org.springframework:spring-beans:jar:3.1.0.RELEASE:compile
| | +- org.springframework:spring-aop:jar:3.1.0.RELEASE:compile
| | +- org.springframework:spring-aspects:jar:3.1.0.RELEASE:compile
| | +- org.springframework:spring-orm:jar:3.1.0.RELEASE:compile
| | | +- org.springframework:spring-jdbc:jar:3.1.0.RELEASE:compile
| | | \- org.springframework:spring-tx:jar:3.1.0.RELEASE:compile
| | \- org.springframework:spring-core:jar:3.1.0.RELEASE:compile
| +- org.springframework:spring-webmvc:jar:3.1.0.RELEASE:compile
| | +- org.springframework:spring-asm:jar:3.1.0.RELEASE:compile
| | +- org.springframework:spring-context-support:jar:3.1.0.RELEASE:compile
| | +- org.springframework:spring-expression:jar:3.1.0.RELEASE:compile
| | \- org.springframework:spring-web:jar:3.1.0.RELEASE:compile
| \- org.springframework:spring-test:jar:3.1.0.RELEASE:compile
\- org.springframework:spring-test-mvc:jar:1.0.0.BUILD-SNAPSHOT:test
edit 2:
For some curious reason, when I delete all Spring 3.0.6 libs from my .m2 folder and then package the webapp, it will download all the 3.0.6 jars again. The dependency tree however is the one above. I assume it has to do with spring-security which has some issue with the version and requires me to override the transient dependencies in my security module pom so it won't use the older ones...
edit 3:
It's spring-data-jpa. Appearently the latest version still depends on Spring 3.0.6. I can get it to play along with Spring 3.1 by overriding the dependencies in the pom, so the tests run through. When integrating my data module into my webapp however it will try to use Spring 3.0.6... No idea how to get around that problem. Even the latest Realase Candidate for spring-data-jpa (version 1.1.0.RC1) still depends on Spring 3.0.7...