catalina.bat start not working

限于喜欢 提交于 2019-12-01 05:48:53
Joe
Error Message: java.lang.NoSuchMethodError: javax.servlet.ServletContext.getSessionCookieConfig()
Ljavax/servlet/SessionCookieConfig;

Symptoms: Tomcat cannot start

Probable Causes: This is a new method in Servlets 3.0 (which Tomcat 7 supports). There is a Servlets 2.x API is your CLASSPATH or JDK's extension directory. Solution: Check your CLASSPATH. Remove servlet-api.jar from JDK's extension directory if any.

Source: http://www3.ntu.edu.sg/home/ehchua/programming/howto/Tomcat_HowTo.html

I resolved this exact error by adding the following jars to my tomcat/lib directory:

javax.persistence-2.0.0.jar

persistence-api-1.0.2.jar

You can find the latest versions here: http://mvnrepository.com/

This can also happen if you have compiled a jar that includes it's runtime dependencies, and has a reference to an old version of the tomcat servlet-api.jar.

Then when your jar is loaded in a different version of Tomcat, the servlet api is incorrect, and it throws this error.

So check how your jar is compiled and make sure it's not including the servlet-api.jar as a dependency in some way!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!