0

I get the below error when I run my Spring project..I followed multiple SO links and implemented everything but still I have the same problem.

java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener

I have attached my project Maven depedencies, deployment assembly and wtpwebapps lib folder to show all the dependencies..

Not sure what else Im missing.

enter image description here

enter image description here

enter image description here

Stack

SEVERE: 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:1680)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4153)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4709)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1060)
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:822)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1060)
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
    at org.apache.catalina.core.StandardService.start(StandardService.java:525)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:759)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
9
  • Add full stacktrace to yous question please! Commented Aug 10, 2015 at 1:40
  • @Jorge:I have added it.. Commented Aug 10, 2015 at 1:43
  • Try to add the spring-context jar to your dependencies, see this link: mvnrepository.com/artifact/org.springframework/spring-context/… Commented Aug 10, 2015 at 1:45
  • I added it but still same pobrlme Commented Aug 10, 2015 at 1:48
  • Another thing, change the version of your spring web to same as other spring dependencies. Your current version is 3.0.5 and other spring dependencies is 3.2.8 (the spring security is ok since it uses another versioning timeline) Commented Aug 10, 2015 at 1:48

2 Answers 2

1

You should have this in your pom.xml

<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-web</artifactId>
    <version>3.0.5.RELEASE</version>
</dependency>

Also you can try:

  • Right click on your project
  • "Propeties"
  • Deployment Assembly
  • Add
  • Java Build Path Entries
  • Maven Dependencies (Selected them all)
  • Finish
Sign up to request clarification or add additional context in comments.

1 Comment

Yes I saw them, that's why I add the part of adding all the dependencies.
0

Your project setup shows there is jar file missing or your are pointing to missing jar file in your project build path.

Right click on your project ==> Go to Build Path ==> In Libraries tab..

You can see the jar files missed with red color cross mark delete them (if you need them add those missing jars in your path)

And re-build the project.

1 Comment

Could you post the full the stack trace, might be there is some different issue & not related to contextloaderlistener?

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.