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

后端 未结 30 1361
南旧
南旧 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:19

    I tried the

    • project clean mvn
    • clean
    • clean tomcat work directory Automatically
    • update dependencies

    The only thing that worked at least temporarily was to add Maven Dependencies to Web Deployment Assembly definition

    But this does not work for ever! After a couple of days it stops working. My solution was to remove Maven Dependencies, apply change and add Maven Dependencies again.

    I'm using - eclipse Juno - embedded maven - tomcat 7

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

    Using the "Update project configuartion" messed up the build path of the project.

    Fix: Open the "configure build path..." menu (right click on the project) and fix the Included/Excluded options for each source folder. That worked for me.

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

    This is surely Eclipse related issue. The thing which worked for me is creating a new server in eclipse server tab. Then run your application in this new server, it should work.

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

    I had a similar problem when running a spring web application in an Eclipse managed tomcat. I solved this problem by adding maven dependencies in the project's web deployment assembly.

    1. Open the project's properties (e.g., right-click on the project's name in the project explorer and select "Properties").
    2. Select "Deployment Assembly".
    3. Click the "Add..." button on the right margin.
    4. Select "Java Build Path Entries" from the menu of Directive Type and click "Next".
    5. Select "Maven Dependencies" from the Java Build Path Entries menu and click "Finish".

    You should see "Maven Dependencies" added to the Web Deployment Assembly definition.

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

    Actually this is a problem of Tomcat. Just go to 'lib' folder of your project and copy your all 'Spring' related jars into this. Refresh your project and you are all good to go. This problem sometime persists because tomcat is unable to locate Spring core classes.

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

    If you are using IntelliJ IDEA, and deploy application on Tomcat Server, it says: Under File menu -> select project Structure -> click artifact -> select your jars and right click -> put in WEB\lib -> restart server

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