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

后端 未结 30 1363
南旧
南旧 2020-11-22 16:58

I included these in the Build Path:

  • all Spring libs
  • Apache Tomcat 7.0 library

The project still fails during startup:

相关标签:
30条回答
  • 2020-11-22 17:26

    For me the fix was to right click on my webapp module > Maven > Update Project

    0 讨论(0)
  • 2020-11-22 17:27

    if nothing from above works, remove the .class from the listener class i.e.

    <listener>
    <listener-class>
    
    org.springframework.web.context.ContextLoaderListener.class
    
    </listener-class>
    </listener>
    
    0 讨论(0)
  • 2020-11-22 17:30

    The actual solution for me was to install the "m2e-wtp - Maven integration for WTP". The solution of Marcelo is not neccessary in that case.

    0 讨论(0)
  • 2020-11-22 17:31

    Solution for Eclipse Luna:

    1. Right Click on maven web project
    2. Click 'Properties'menu
    3. Select 'Deployment Assembly' in left side of the popped window
    4. Click 'Add...' Button in right side of the popped up window
    5. Now appear one more popup window(New Assembly Directivies)
    6. Click 'Java Build path entries'
    7. Click 'Next' Button
    8. Click 'Finish' Button, now atomatically close New Assemby Directivies popup window
    9. Now click 'Apply' Button and Ok Button
    10. Run your webapplication
    0 讨论(0)
  • 2020-11-22 17:31

    For gradle users, It works with following steps

    1) Stop and Delete tomcat server from Servers Tab in eclipse

    eclipse tomcat tab

    2) clean webapp and work directory from tomcat installation , (Reference, How-To: Clear out Tomcat’s cache and fix outdated JSP problems)

    $ rm -r /usr/local/AT7028/work/*
    $ rm -r /usr/local/AT7028/webapps/WAR_NAME
    

    3) clean and eclipsify project using build tool

    $ ./gradlew clean eclipse //fire respective command for mvn users, $ mvn clean package

    4) configure a new Tomcat server in eclipse, and run the project again.

    0 讨论(0)
  • 2020-11-22 17:31

    This happened to me after I made changes to my Hibernate mapping in an IntelliJ project using Gradle. Simply rebuilding the project worked for me.

    0 讨论(0)
提交回复
热议问题