The method getJspApplicationContext(ServletContext) is undefined for the type
JspFactory的异常的原因及解决办法原因:
服务器环境Jboss,Java程由Tomcat5.5工程目录直接拷贝,由于WEB-INF/lib下存在jsp-api.jar、servlet-api.jar,与Jboss自带的jar包冲突造成。
解决办法:
删除WEB工程Lib目录中的jsp-api.jar、servlet-api.jar,重新启动Jboss服务问题解决。
标记:
在创建工程时,jsp-api.jar、servlet-api.jar这两个jar包都无需手工加入到web工程中,tomcat与jboss都已包含。
近在学Acegi,就试着运行一个小例子,不成想抛出下面的异常
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:423)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:308)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:273)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:566)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
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)
上网搜,发现不少人有这个问题,但都没有解决办法。后来想到可能和tomcat6有关,因为我在工程的lib中添加了很多包(一堆什么Spring
依赖),所以把他们一删JSP就不抛异常了。我估计是,工程中和tomcat6 lib中重复的包在加载时是先被加载(也就是tomcat6中相同的包没
有被加载),而工程中的包版本要比tomcat6中的低,造成上面的异常。我对照着tomcat中包,发现工程中出现诸如catalina.jar、jsp-api.jar
、servlet-api.jar等这样的重复包,把它们从工程中删了就应该行了(对于上面的异常,原因应该是包jsp-api.jar)。看来不是什么包都可以一股脑往工程里加啊。
分享到:
相关推荐
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 ...
ServletContext代码,开发工具 Myeclipse
这是servlet中ServletContext的应用实例,主要就是添加属性和读取属性。
ServletContext与ServletConfig关系
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的学习,并使用实例进行了实战。完成了一个登录和统计登录人数的功能。
ServletContext读取web应用中的资源文件
Ssh获取ServletContext 只需要更改struts-config action中的type就可以了ru :type="com.uo.spring.SpringDelegatingActionProxy" 大家有什么疑问可以直接去我的blog查看...《[正解]Ssh获取ServletContext》
quartz servletcontext quartz servletcontext配置资料quartz servletcontext配置资料
超全面javaweb教程28天第9天_14_获取ServletContext对象
NULL 博文链接:https://onway417.iteye.com/blog/2194540
注意:每个servlet有一个ServletConfig,每个Web应用有一个ServletContext.要把初始化参数认为是部署时常量,可用在运行时得到这些初始化参数,但不能设置初始化参数,根本没有setInitParameter().如果修改XML来改变...
It mostly contains the request information, ServletContext initialization parameters, ServetContext attributes, request headers, response headers etc. sendRedirect In JSP sendRedirect() method is a ...
博客地址:...存放数据指的是这三个对象在工程中setAttribute(),removeAttribute()的时候,我们的监听器就会知道,然后在对应的方法中执行相应的操作。
Servlet生命周期,及servlet相关知识点的总结。
ServletContext官方叫servlet上下文。服务器会为每一个工程创建一个对象,这个对象就是ServletContext对象。这个对象全局唯一,而且工程内部的所有servlet都共享这个对象。所以叫全局应用程序共享对象。
Application对象(ServletContext对象).pptx
很清楚的讲解了ServletContext和ServletConfig,不光有理论上的讲解,还有例子。
介绍 ServletContext对象的一些重要方法的示例代码
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?