Am very new to spring and JUnit. Am trying to run a simple JUnit test case for spring service class, but it fails and I get this exception.I didnt write any test yet, but t
The problem is that you are mixing different versions of Spring, you are mixing (2.0.8, 3.1.4 and 4.0.2) in your project. That is trouble waiting to happen.
To prevent these kind of things there is now a so called "bill of materials" POM which you can import.
You need to add a dependencyManagement section to import the bom.
org.springframework
spring-framework-bom
4.0.5.RELEASE
pom
import
Now in your dependencies you can remove the version and replace spring-dao with spring-orm. Added benefit is that all your spring-* dependencies will now be managed to the latest release and you only have a single location for your version number.
org.springframework
spring-beans
org.springframework
spring-context
org.springframework
spring-context-support
org.springframework
spring-core
org.springframework
spring-jdbc
org.springframework
spring-orm
You could apply the same trick for Spring Data as that also has a bom.