`
hetaoo
  • 浏览: 106748 次
社区版块
存档分类
最新评论

The method getJspApplicationContext(ServletContext) is undefined for the type Js

阅读更多

转至:http://saber5d.blog.163.com/blog/static/1279987782010119113746918/

type Exception report
message 
description The server encountered an internal error () that prevented it from fulfilling this request.
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:
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:334)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:312)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:299)
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)
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.24 logs.
Apache Tomcat/6.0.24
后来在网上查了查,说是因为项目中有像jsp-api.jar servlet-api.jar跟tomcat6的lib中同样的包,但版本比tomcat6的版本要低,在运行的时候,因为会优先加载项目中的包,所以 产生了错误,把项目中和tomcat相同的包删除(必须删除,如果替换还会产生其他的错误),问题就可以解决了。
实际通过这个问题,则可以明白,在布署jsp网站(在tomcat上)的时候,项目中的jar包不能有和tomcat的lib中相同的包(自己包的版本比 tomcat低或相同),否则会因为先加载自己项目中的包而导致程序错误。所以在有相包的情况的时候,将自己的包给删掉,就不会出现问题了。

分享到:
评论

相关推荐

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

    Java_for_the_Web_with_Servlets

    - **Configuration Information**: Servlets can obtain configuration information using the `ServletConfig` object, which is passed to the `init()` method during initialization. - **`ServletContext` ...

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

    JSP Simple Examples

    and one of the feature of OOP in java is that, we can assign a subclass object or variable to the variable of the superclass type. Log files Log files keeps a records of internet protocol addresses...

    ServletContext

    `ServletContext`是Java Web开发中的一个关键概念,它是Servlet API的一部分,主要用于在多个Servlet之间共享信息。在Myeclipse这样的集成开发环境中,我们经常会用到`ServletContext`来增强应用程序的功能和交互性...

    Spring-for -servletcontext1.0.jar

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

    servlet中的ServletContext的使用

    在Servlet的世界里,`ServletContext`扮演着至关重要的角色。它是一个全局的、跨.servlet共享的上下文对象,为整个Web应用提供了一个共享数据和资源的平台。在这个实例中,我们将深入探讨`ServletContext`如何用于...

    ServletContext与ServletConfig关系

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

    35、servlet--servletContext

    在提供的`login`子文件夹中,通常会包含与用户登录相关的Servlet、JSP页面、CSS样式表、JavaScript脚本等。可能有一个登录Servlet负责处理用户提交的登录请求,验证用户名和密码,然后使用`servletContext`来共享...

    servletContext的实例代码

    在Java Web开发中,`ServletContext`是一个至关重要的接口,它代表了整个Web应用程序的上下文。这个上下文包含了关于Web应用的所有信息,如全局的初始化参数、资源、以及与所有Servlet共享的对象。在这个实例中,...

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

    ServletContext 读取 web 应用中的资源文件 在 Web 应用程序中,我们经常需要读取某些资源文件,如配置文件、图片等等。为了实现这一点,ServletContext 接口提供了一些方法来读取 web 应用中的资源文件,这些方法...

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

    Error creating bean with name 'org.springframework.web.servlet.handler.SimpleUrlHandlerMapping#0' defined in ServletContext ... Does the parameter type of the setter match the return type of the getter?

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

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

    quartz servletcontext配置资料

    = null && scheduler.isStarted()) { scheduler.shutdown(); } } ``` ### 使用ServletContext进行任务触发 在Servlet或Filter中,可以通过ServletContext获取到Scheduler实例,然后根据需要动态添加或删除任务...

    ServletContext与application异同.docx

    【ServletContext与Application的理解】 在Java Web开发中,`ServletContext`和`Application`是两个非常重要的概念,它们在一定程度上有着密切的联系。`ServletContext`是Servlet API中的一个接口,它代表了一个Web...

    ServletContext接口

    ### ServletContext接口详解 在Java Web开发中,`ServletContext`接口扮演着至关重要的角色,它提供了应用程序上下文的全局视图,使得多个Servlet之间能够共享数据,并且为Servlet容器提供了访问资源、初始化参数...

    ServletContext介绍及用法.docx

    【ServletContext详解】 Servlet上下文(ServletContext)是Java Web开发中的一个重要概念,它是服务器为每个Web应用程序创建的一个全局共享对象。这个对象在整个Web应用中独一无二,所有的Servlet都可以访问它,...

    servletcontext详解

    ### ServletContext详解 #### 一、概述 `ServletContext`接口是Servlet与Servlet容器之间进行通信的重要接口之一。当Servlet容器启动一个Web应用时,会为该应用创建一个`ServletContext`对象,这个对象在整个Web...

    使用ServletContext对象完成网页计数器

    `ServletContext`对象是Servlet容器(如Tomcat、Jetty等)为每个Web应用程序创建的一个全局对象,它在整个Web应用的生命周期内都存在,为所有Servlet提供了一个共享数据和资源的平台。在本例中,我们探讨的是如何...

Global site tag (gtag.js) - Google Analytics