Java. Lang. nosuchmethoderror: javax. servlet. servletcontext. getinclutivesessiontrackingmodes ()

Source: Internet
Author: User

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:

  1. Yourweb.xmlIs
    Not declared conform at least servlet 3.0.

  2. Your servlet container does not support at least servlet 3.0.

  3. You have servlet container specific libraries of an older version in/WEB-INF/lib.

To solve this problem,

  1. 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>
  2. 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.

  3. 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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.