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

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

    I used IntelliJ IDEA, compilation is successful, but when starting Tomcat, it says:

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

    In the beginning, I thought the JAR was missing, but it was in place.

    Solution: File > Project Structure > Artifacts, in the Output Layout double click in right panel Available Elements the library named like Maven:..., it will be moved to WEB-INF/lib in the left pane.

    Accept and restart Tomcat.

提交回复
热议问题