2

Hi! Although I've found very similar questions over the forum, none of them was meeting my requirement.

I am using Tomcat 7 to deploy my spring app. However, I am facing:

�?java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener’ error, java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559) at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:532) at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:514) at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:133) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4727) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5285) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:618) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1100) at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1618) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at java.lang.Thread.run(Thread.java:722)

Oct 09, 2012 7:37:32 PM org.apache.catalina.core.StandardContext listenerStart SEVERE: Skipped installing application listeners due to previous error(s) Oct 09, 2012 8:00:48 PM org.apache.catalina.core.ApplicationContext log

I have verified that org.springframework.web-3.1.2.RELEASE.jar is present in the WEB-INF\ \lib\ folder and the required file is present inside it. Kindly note that I am not using any build tool to deploy this web-app like maven.

I have tried to clean and reinstall the app, restarted Tomcat, but didn't have any luck.

Please help.

4
  • 1
    Check that eclipse (I think you use eclipse because you "cleaned" the server) has really copied the org.springframework.web-3.1.2.RELEASE.jar to the server Commented Oct 9, 2012 at 15:16
  • hi ralph, thankx for your valuable input but right now I am doing a manual copy of my webapp in a separate copy of tomcat running on different folder. Commented Oct 9, 2012 at 16:22
  • Can you post a directory listing so we can verify all the files? Commented Oct 9, 2012 at 16:50
  • Maybe the jar file is corrupted, so download the org.springframework.web-3.1.2.RELEASE.jar again and put it in the WEB-INF folder. (And check that there is no other jar that contains the same class too.) Commented Oct 10, 2012 at 4:58

3 Answers 3

0

In WEB-INF\ \lib\ where? In artifacts, or in the project? if it is in the project then it does not mean it is in classpath, If you are using eclipse and did not edit output classpath by eclipse - tomcat setting then you should make sure the .jar file is in: ..\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\YourApp\WEB-INF\lib

that is the default place that eclipse makes artifact and deploys it from there. So make sure you included jar file in eclipse build path configuration. First time when you add new jar or something that related to classpath then do: right click on tomcat(in eclipse) then publish from menu, By this way eclipse updates whole artifact.

2
  • hi elbek thanks for your answer but right now I am doing a manual deployment by placing my web app directly to tomcat web-apps folder, As I already mentioned that I am not using maven here to keep things simple. its directly placed like e:\tomcat7\webapps\springMvc\WEB-INF\lib folder. Commented Oct 9, 2012 at 16:21
  • for the deployment way that i said does not require maven, just eclipse, Ok i got your situation, that is strange, what is your web.xml file? this should be path for listener: org.springframework.web.context.ContextLoaderListener Commented Oct 9, 2012 at 16:26
0

Worth verifying if you have the project structure and required jars in classpath. You can take help of this if required for set up.

0

If you are sure all the jars are available in your lib directory, try cleaning tomcat work directory. From eclipse (servers view), right click on Tomcat server and then click on the menu "Clean Tomcat Work Directory).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.