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

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

提交回复
热议问题