Search code examples
javaeclipsespringm2eclipse

Can't run spring project from eclipse, ClassNotFoundException: org.springframework.web.context.ContextLoaderListener


I'm having trouble running my spring project from inside Eclipse.

This is the error I get:

SEVERE: Error configuring application listener of class org.springframework.web.context.ContextLoaderListener
java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener

Here are the Tomcat settings:

Here are the settings

I don't understand why it's not working, the spring classes are included in the classpath.


Solution

  • You need the spring-web jar. I see you're using maven:

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

    NOTE: that the latest release is 3.0.5.RELEASE. Also, you can identify the spring project by the package, i.e. org.springframework.web