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

hibernate, spring

Solution

Is not wise mix Spring versions in one project.

The error is, you have the `spring-core` module working with `3.0.5` and the rest of modules with `4.0.6`

Problem

I am trying to work out my spring hibernate with maven dependencies. My server is not starting up and throwing this error: ``` java.lang.NoClassDefFoundError: org/springframework/core/DefaultParameterNameDiscoverer ``` I don't know whether it is a problem with my dependencies or with my server. Let me know if anything would be needed from my project. Here are the dependencies I've added in my pom.xml file. I am using maven 4.0.0. ``` <properties> <spring.version>3.0.5.RELEASE</spring.version> </properties> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> <scope>test</scope> </dependency> <!-- Spring 3 dependencies --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-core</artifactId> <version>${spring.version}</version> </dependency> <!-- <dependency> <groupId>org.springframework</groupId> <artifactId>spring-core</artifactId> <version>3.2.3.RELEASE</version> </dependency> --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-orm</artifactId> <version>4.0.6.RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-web</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-core</artifactId> <version>4.3.5.Final</version> <type>jar</type> <scope>compile</scope> </dependency> <!-- Hibernate annotation --> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-ehcache</artifactId> <version>4.3.5.Final</version> </dependency> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>5.1.31</version> </dependency> </dependencies> <repositories> <repository> <id>abc</id> <url>http://repo1.maven.org/maven2</url> </repository> </repositories> ```

Original source