java.lang.ClassNotFoundException: javax.servlet.ServletContainerInitializer

后端 未结 5 827
被撕碎了的回忆
被撕碎了的回忆 2020-12-19 02:16

I was working on writing some servlets and they all worked fine Tomcat had no issue running what so ever. Then I wrote a class file that used JERSEY and when I tried to run

5条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-19 02:28

    javax/servlet/ServletContainerInitializer is a class in Servlet 3.0 which is not support in Tomcat 6.

    You probably have servlet.jar floating around somewhere in your CLASSPATH, it shouldn't be. This really messes up the classloaders since Tomcat's classloaders don't act quite as normal as one expects (see links above). servlet.jar should only be found only once in $CATALINA_HOME/lib.

提交回复
热议问题