NoSuchMethodError的解决方案(The method getJspApplicationContext(ServletContext) 问题)

来源:互联网 发布:手机淘宝联盟怎么注册 编辑:程序博客网 时间:2024/06/04 19:32

HTTP Status 500 -


type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: java.lang.NoSuchMethodError: javax.servlet.jsp.JspFactory.getJspApplicationContext(Ljavax/servlet/ServletContext;)Ljavax/servlet/jsp/JspApplicationContext;org.apache.jasper.servlet.JspServlet.service(JspServlet.java:274)javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

root cause

java.lang.NoSuchMethodError: javax.servlet.jsp.JspFactory.getJspApplicationContext(Ljavax/servlet/ServletContext;)Ljavax/servlet/jsp/JspApplicationContext;org.apache.jsp.index_jsp._jspInit(index_jsp.java:27)org.apache.jasper.runtime.HttpJspBase.init(HttpJspBase.java:80)org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:163)org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:326)org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

note The full stack trace of the root cause is available in the Apache Tomcat/6.0.2 logs.


Apache Tomcat/6.0.2

注意,出现这种问题的原因是tomcat的版本不同而造成的问题,原先使用的tomcat版本为5.5,现在换成了6.0.2。两个版本之间是有差异的,在5.5中WEB-INF下lib中含有jsp-api.jar包,而在6.0.2已经不需要将这个包显示的的加入lib中,因此将此jar包删除即可。

原创粉丝点击