jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class

后端 未结 12 679
有刺的猬
有刺的猬 2020-11-27 03:58

I am running a Maven project which is also a dynamic web project. I have used all Spring libraries in Maven. I created web.xml, but when I start my Tomcat 7 ser

12条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-27 04:39

    You get this warning message when the servlet api jar file has already been loaded in the container and you try to load it once again from lib directory.

    The Servlet specs say you are not allowed to have servlet.jar in your webapps lib directory.

    • Get rid of the warning message by simply removing servlet.jar from your lib directory.
    • If you don't find the jar in the lib directory scan for your build path and remove the jar.

    C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps\project\WEB-INF\lib
    

    If you are running a maven project, change the javax.servlet-api dependency to scope provided in you pom.xml since the container already provided the servlet jar in itself.

提交回复
热议问题