Recently, When I upgraded JBoss from 4.2.2 to 6.0.0, I encountered various problems, mainly due to class version conflicts. It is easy to find out all the problems before the server runs, the first access throws this exception.
An exception or error occurred in the container during the request processing: Java. Lang. nosuchmethoderror: javax. servlet. servletcontext. getinclutivesessiontrackingmodes () ljava/util/set;
At org. Apache. Catalina. connector. coyoteadapter. postparserequest (coyoteadapter. Java: 567)
At org. Apache. Catalina. connector. coyoteadapter. Service (coyoteadapter. Java: 359)
At org. Apache. Coyote. http11.http11processor. Process (http11processor. Java: 877)
At org. Apache. Coyote. http11.http11protocol $ http11connectionhandler. Process (http11protocol. Java: 654)
At org.apache.tomcat.util.net. jioendpoint $ worker. Run (jioendpoint. Java: 951)
At java. Lang. thread. Run (thread. Java: 679) [: 1.6.0 _ 22]
I searched for it. The following article is more detailed and I will share it with you.
Http://stackoverflow.com/questions/8969497/java-lang-nosuchmethoderror-javax-servlet-servletcontext-geteffectivesessiont
Post content:
Java. Lang. nosuchmethoderror: javax. servlet. servletcontext. getinclutivesessiontrackingmodes () ljava/util/set;
This method is introduced in
Servlet 3.0. This error can have at least the following causes:
-
Yourweb.xmlIs
Not declared conform at least servlet 3.0.
-
Your servlet container does not support at least servlet 3.0.
-
You have servlet container specific libraries of an older version in/WEB-INF/lib.
To solve this problem,
-
Ensure that yourweb.xmlRoot
Declaration conforms servlet 3.0:
<?xml version="1.0" encoding="UTF-8"?><web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0"> <!-- Config here. --></web-app>
-
Ensure that you're deploying to a servlet 3.0 compatible container. In case of JBoss as that wocould be at least version 6.0.0.
-
Ensure that you don't have those libraries in/WEB-INF/lib.
They do not belong there. This is a common beginner's mistake to "solve" compilation errors they faced in their ide. See also how
Do I import the javax. servlet API in my Eclipse project?
You 've declared yourweb.xmlConform
Servlet 2.2. This is definitely wrong. Fix it accordingly.