Error after launching Tomcat deployment project in Eclipse:
Shell Code
Severity: Error Configuring Application Listener of Class Org.springframework.web.context.ContextLoaderListener
Java.lang.ClassNotFoundException:org.springframework.web.context.ContextLoaderListener
At Org.apache.catalina.loader.WebappClassLoader.loadClass (Webappclassloader.java:1678)
At Org.apache.catalina.loader.WebappClassLoader.loadClass (Webappclassloader.java:1523)
At Org.apache.catalina.core.DefaultInstanceManager.loadClass (Defaultinstancemanager.java:415)
At Org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged (Defaultinstancemanager.java:397 )
At Org.apache.catalina.core.DefaultInstanceManager.newInstance (Defaultinstancemanager.java:118)
At Org.apache.catalina.core.StandardContext.listenerStart (Standardcontext.java:4660)
At org.apache.catalina.core.standardcontext$1. Call (Standardcontext.java:5226)
At org.apache.catalina.core.standardcontext$1. Call (Standardcontext.java:5221)
At Java.util.concurrent.futuretask$sync.innerrun (Futuretask.java:303)
At Java.util.concurrent.FutureTask.run (Futuretask.java:138)
At Java.util.concurrent.threadpoolexecutor$worker.runtask (Threadpoolexecutor.java:886)
At Java.util.concurrent.threadpoolexecutor$worker.run (Threadpoolexecutor.java:908)
At Java.lang.Thread.run (Thread.java:662)
Issue Background :
Project for MAVEN Engineering, the Contextloaderlistener class is located in the Spring-web-3.1.0.release.jar package. The pom.xml of Maven was checked, and the dependency was introduced properly. In the project Maven dependencies view, it is also possible to see that the Spring-web-3.1.0.release.jar package is introduced in the normal.
Cause of Error:
Tomcat did not release the jar packages added by Maven dependencies at the time of publishing the project
Solution:
1. Right click on the project-select Properties
Select Deployment Assembly, click the Add button on the right, and select Java Build Path Entries in the popup window. As shown in the following:
2. Click Next to select Maven Dependencies
3. Click Finish, and you can see that maven dependencies has been added to the Web application structure.
After the operation, redeploy the project, no longer error.
Can be viewed, our deployment is as follows:
So finally we released the war package, extracted after the directory as follows:
Explain: 1. Is the wepapp underneath something we can see the original directory under something, posted in/below
2. This is/src/main/java below the Java source code file, the compiled bytecode file placed under Web-inf/classes
3.mavene Dependeny The following Jia package is published under/web-inf/classes.
Eclipse Error: Java.lang.ClassNotFoundException:Contex