`
demojava
  • 浏览: 542218 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

jsp The method getJspApplicationContext(ServletContext) is undefined for the typ

 
阅读更多

The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory的解决方法:

环境:Tomcat6,  IDE Myeclipse

 

Myeclipse控制台显示信息:

严重: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: Unable to compile class for JSP:

An error occurred at line: 23 in the generated java file
The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory

Stacktrace:
 at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:92)
 at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
 at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:439)
 at org.apache.jasper.compiler.Compiler.compile(Compiler.java:349)
 at org.apache.jasper.compiler.Compiler.compile(Compiler.java:327)
 at org.apache.jasper.compiler.Compiler.compile(Compiler.java:314)
 at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:589)
 at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
 at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
 at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
 at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:859)
 at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579)
 at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1555)
 at java.lang.Thread.run(Thread.java:619)

 

前台页面显示:

org.apache.jasper.JasperException: Unable to compile class for JSP: 

An error occurred at line: 23 in the generated java file
The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory

Stacktrace:
	org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:92)
	org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
	org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:439)
	org.apache.jasper.compiler.Compiler.compile(Compiler.java:349)
	org.apache.jasper.compiler.Compiler.compile(Compiler.java:327)
	org.apache.jasper.compiler.Compiler.compile(Compiler.java:314)
	org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:589)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

 

因为项目中有像jsp-api.jar servlet-api.jar(主要是这个包引起的)跟tomcat6的lib中同样的包,
但版本比tomcat6的版本要低,在运行的时候,因为会优先加载项目中的包,
所以产生了错误,把项目中和tomcat相同的包删除(必须删除,如果替换还会产生其他的错误),
问题就可以解决了。

分享到:
评论
2 楼 melon_mj 2014-05-08  
删除了还是有同样的问题怎么解决呢?
1 楼 xingchensuifeng 2013-11-13  
删除了还是有这个问题,

相关推荐

    JSP安装运行步骤及遇错处理方法(全集)

    The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory;java.lang.OutOfMemoryError: PermGen space;tomcat 5.5 的The Apache Tomcat Native library which allows optimal ...

    JSP Simple Examples

    Life of the the jsp page is just same as the servlet life cycle. After get translated the jsp file is just like a servlet. Page directive attributes A directive is a way to give special ...

    servlet2.4doc

    The doFilter method of the Filter is called by the container each time a request/response pair is passed through the chain due to a client request for a resource at the end of the chain. doGet...

    ServletContext与ServletConfig关系

    ServletConfig 与 ServletContext 的关系 在 Servlet 编程中,ServletConfig 和 ServletContext 两个对象经常被混淆,然而它们有着截然不同的作用域和用途。 首先, lets 看看 ServletConfig 对象。ServletConfig ...

    Spring-for -servletcontext1.0.jar

    Ssh获取ServletContext 只需要更改struts-config action中的type就可以了ru :type="com.uo.spring.SpringDelegatingActionProxy" 大家有什么疑问可以直接去我的blog查看...《[正解]Ssh获取ServletContext》

    ServletContext

    ServletContext代码,开发工具 Myeclipse

    servlet中的ServletContext的使用

    这是servlet中ServletContext的应用实例,主要就是添加属性和读取属性。

    servletContext的实例代码

    对servletContext的学习,并使用实例进行了实战。完成了一个登录和统计登录人数的功能。

    ServletContext读取web应用中的资源文件.doc

    ServletContext读取web应用中的资源文件

    quartz servletcontext配置资料

    quartz servletcontext quartz servletcontext配置资料quartz servletcontext配置资料

    超全面javaweb教程28天第9天 14 获取ServletContext对象

    超全面javaweb教程28天第9天_14_获取ServletContext对象

    org.springframework.web.servlet-3.0.1.RELEASE-A.jar

    nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userController' defined in ServletContext resource [/WEB-INF/springMVC-servlet.xml]: Error ...

    35、servlet--servletContext

    NULL 博文链接:https://onway417.iteye.com/blog/2194540

    JSP中5种跳转foward,request等等的详细区别

    JSP 中的五种跳转方式详细区别 在 JSP 编程中,跳转是一种常见的技术手段,用于将用户从当前页面重定向到另一个页面。JSP 中有五种跳转方式,包括 RequestDispatcher.forward()、response.sendRedirect()、jsp:...

    jsp基础精华详解

    for(int i=0; i; i++) { Cookie temp = cookies[i]; String key = temp.getName(); String value = temp.getValue(); } 3.隐藏表单域 <input type="hidden" name="name" value="zhangsan" /> request....

    JSP的九个内置对象及四个作用域

    JSP 九个内置对象及四个作用域 JSP(Java Server Pages)是一种基于Java的服务器端脚本语言,用于生成动态网页。在JSP中,九个内置对象是指不需要预先声明就可以在脚本代码和表达式中使用的对象,这些对象都是javax...

    JSP2.0技术手册pdf(带示例源码).zip

    3-2 What is JSP 3-3 JSP 与 Servlet 的比较 3-4 JSP 的执行过程 3-5 JSP 与 ASP 和 ASP+ 的比较 3-6 JSP 2.0 新功能 第四章 JSP 语法 4-1 Elements 和 Template Data 4-2 批注(Comments) 4-3 Quoting 和 Escape ...

    ServletConfig与ServletContext.docx

    注意:每个servlet有一个ServletConfig,每个Web应用有一个ServletContext.要把初始化参数认为是部署时常量,可用在运行时得到这些初始化参数,但不能设置初始化参数,根本没有setInitParameter().如果修改XML来改变...

    jsp跳转的五种方式

    实现jsp页面间的跳转 public void doPost(HttpServletRequest request,HttpServletResponse response) throws ServletException,IOException {  response.setContentType("text/html; charset=gb2312");  ...

    ServletContext与application异同.docx

    ServletContext与application异同.docx

Global site tag (gtag.js) - Google Analytics