SEVERE: Error configuring application listener of class org.springframework.web.context.ContextLoaderListener java.lang.NoClassDefFoundError:
For this error, there can be different solutions. I have noted down the ones that had worked for me.
Solution 1.This is always happened in deployment and debugging environment. In deployment environment, just make sure your server classpath has included the Spring jar library (e.g spring-4.0.4.jar).
In debugging environment, the steps may vary from different IDE, but the solution is same. In Eclipse, developers usually will create a tomcat, jboss…whatever application server for debugging, just make sure the correct Spring jars are included.
Double click on your debugging server
Click on the “Open launch configuration” to access the server environment
Click on the classpath tab
Include the Spring jar file here , it may also required common log jar due to Spring dependency.
Done, run your application again.
.
Solution 2.If you are using Maven as a build tool and downloading dependencies using it, there can be some jar conflict. Because Tomcat servers normally provide some jars such as servlet-api and jpa-api. So if you again included them using maven; there will be problems in identifying them.
Solution 3.If you are using Eclipse as your IDE and using Maven as your build tool and tomcat as your server; remember Tomcat server will not look on the jars which are just inside the folders. For that there’s a small trick,
Right click on yourprojectand selectproperties
From the displayed window, selectDeployment Assembly
SelectAdd
AddMaven dependencies
ClickApplyand ClickOK
Hope one of these solutions would help you to solve your problem. Happy Coding and make sure that is using Java.
Similar Posts:
- [Solved] Eclipse Error: java.lang.ClassNotFoundException: ContextLoaderListener
- It is indirectly referenced from required .class files
- HTTP Status 500 – Unable to compile class for JSP settlement program
- The difference between web app libraries and referenced libraries in eclipse project
- Tomcat10 Error: java.lang.NoClassDefFoundError: javax/servlet/ServletContextListener
- Error reporting when importing Maven project from MyEclipse
- Pom.xml error: org.codehaus.plexus.archiver.jar.Manifest.write(java.io.PrintWriter) solution
- [maven-38382;- 39064; java.lang.NoSuchMethodError: javax.ws.rs.core.Application.getProperties()Ljava/util/Map
- Springboot always reports an error when importing JSP dependencies
- [Solved] maven 3.5.0 combined with eclipse suggests solutions to lambda expressions are allowed only at source level 1.8 or above errors