ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/web].[action]] Servlet.service() for servlet action threw exception
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 22 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:415)
...
解决方法:
删除应用发布程序中lib目录下的:j2ee.jar 包 然后重新启动jboss4.2即可
原因是 JspFactory.class 在以下两个jar包里都存在,需要删除一个。
n jboss- 4.2.2 .GA_XHITSM/server/default/lib/jsp-api.jar
n 自己工程下的 uams/WEB-INF/lib/j2ee.jar