Receiving a NoClassDefFoundError even though jar is successfully downloaded via Maven and referenced in pom.xml

231 views Asked by At

Runtime exception I am receiving is:

Caused by: java.lang.NoClassDefFoundError: org/springframework/core/io/Resource

Even though there are no errors within my project and I've updated via 'Maven update' and running 'Maven clean install' builds successfully. The dependency in my pom.xml is:

<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-core</artifactId>
    <version>4.1.4.RELEASE</version>
    <scope>compile</scope>
</dependency>

Have also tried with scope set to 'provided' and with no scope at all. Any ideas how to resolve this issue?

2

There are 2 answers

0
smoggers On BEST ANSWER

Well I have found a workaround solution but still not sure how/why Eclipse is no longer picking up Maven dependencies from the pom. Instead I have had to go into the Maven dependencies folder and copy and paste all dependencies required into the /WEB-INF/lib folder and finally application has launched successfully again with no runtime exceptions.

5
ibrahimbayer On

This error is different then ClassNotFoundException, the error means the class is in classpath but not suitable. So the problem isn't related to maven it should be jdk version or any other inconsistency. Can you check your jdk version?