java.lang.NoSuchMethodError: javax.servlet.ServletContext.getEffectiveSessionTrackingModes()
来源:互联网 发布:算法竞赛 编辑:程序博客网 时间:2024/06/01 13:07
最近在把jboss从4.2.2升级到6.0.0时候,遇到各种各样的问题,主要都是类版本冲突,好容易把问题都找出来服务器run起来之前,第一次访问抛出了这个异常
An exception or error occurred in the container during the request processing: java.lang.NoSuchMethodError: javax.servlet.ServletContext.getEffectiveSessionTrackingModes()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]
搜了一下,下面这篇文章讲得比较仔细,果断分享之
http://stackoverflow.com/questions/8969497/java-lang-nosuchmethoderror-javax-servlet-servletcontext-geteffectivesessiont
贴出内容:
java.lang.NoSuchMethodError: javax.servlet.ServletContext.getEffectiveSessionTrackingModes()Ljava/util/Set;
This method is introduced in Servlet 3.0. This error can have at least the following causes:
Your
web.xml
is 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 your
web.xml
root 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 would 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 your web.xml
conform Servlet 2.2. This is definitely wrong. Fix it accordingly.
- java.lang.NoSuchMethodError: javax.servlet.ServletContext.getEffectiveSessionTrackingModes()
- java.lang.NoSuchMethodError: javax.servlet.ServletContext.getContextPath()
- java.lang.NoSuchMethodError: javax.servlet.ServletContext.getContextPath()
- java.lang.NoSuchMethodError: javax.servlet.ServletContext
- java.lang.NoSuchMethodError: javax.servlet.ServletContext.getContextPath()
- java.lang.NoSuchMethodError: javax.servlet.ServletContext.getContextPath()Ljava/lang/String;
- java.lang.NoSuchMethodError: javax.servlet.ServletContext.getContextPath()Ljava/lang/String;
- java.lang.NoSuchMethodError: javax.servlet.ServletContext.getContextPath()Ljava/lang/String;
- java.lang.NoSuchMethodError: javax.servlet.ServletContext.getContextPath()Ljava/lang/String;
- java.lang.NoSuchMethodError: javax.servlet.ServletContext.getClassLoader()Ljava/lang/ClassLoader;
- java.lang.NoSuchMethodError: javax.servlet.ServletContext.getContextPath()Ljava/lang/String;
- java.lang.NoSuchMethodError: javax.servlet.ServletContext.getVirtualServerName()Ljava/lang/String;
- java.lang.NoSuchMethodError: javax.servlet.ServletContext.getContextPath()Ljava/lang/String;
- java.lang.NoSuchMethodError: javax.servlet.ServletContext.getContextPath()Ljava/lang/String;
- jfinal 报异常:java.lang.NoSuchMethodError: javax.servlet.ServletContext.getJspConfigDescriptor
- 一个异常:java.lang.NoSuchMethodError: javax.servlet.jsp.JspFactory.getJspApplicationContext(Ljavax/servlet/ServletContext;)Ljavax/se
- NoSuchMethodError: javax.servlet.ServletContext.getContextPath()Ljava/lang/String
- NoSuchMethodError: javax.servlet.ServletContext.getVirtualServerName()Ljava/lang/String
- 答疑一个哥们的多线程问题关于 start()和run()
- FTP Server报出421错误
- 老外解读:为什么中国移动要和苹果合作
- The 12 Ties that Bind Long-Term Relationships
- this引用
- java.lang.NoSuchMethodError: javax.servlet.ServletContext.getEffectiveSessionTrackingModes()
- mysql下载
- iPhone 自定义控件收集
- magento 翻译修改不生效问题如何解决?
- 一个Linux下C线程池的实现
- oracle 查询所有工作日
- shell ftp
- Linux下判断进程是否存在的好方法
- 学习android开发——环境搭建