0

以前我使用的是 tomcat 7.0.30,最近我搬到了 tomcat 8.0.21

之后,每当我尝试访问我的应用程序时,都会出现如下 JSP 编译错误,

返回类型与 JspSourceDependent.getDependants() 不兼容

也低于错误,

类型 JspFactory 的方法 getJspApplicationContext(ServletContext) 未定义

我也在使用 GWT 2.7.0 和 SmartGWT PRO 4.1

你能建议解决这个问题吗?我浏览了建议的链接,但没有帮助。将 struts 更新到 2.3.20

使用 -verbose:class VM 参数在下面发布完整的堆栈跟踪,

    [Loaded org.apache.commons.lang3.BooleanUtils from file:/E:/apache-tomcat-8.0.21/webapps/UDMUI/WEB-INF/lib/gwt-dev.jar]
[Loaded com.opensymphony.xwork2.ognl.OgnlUtil$2 from file:/E:/apache-tomcat-8.0.21/webapps/UDMUI/WEB-INF/lib/xwork-core-2.3.20.jar]
[Loaded ognl.enhance.OrderedReturn from file:/E:/apache-tomcat-8.0.21/webapps/UDMUI/WEB-INF/lib/ognl-3.0.6.jar]
[Loaded ognl.ASTChain from file:/E:/apache-tomcat-8.0.21/webapps/UDMUI/WEB-INF/lib/ognl-3.0.6.jar]
[Loaded com.opensymphony.xwork2.util.reflection.ReflectionContextState from file:/E:/apache-tomcat-8.0.21/webapps/UDMUI/WEB-INF/lib/xwork-core-2.3.20.jar]
[Loaded ognl.Evaluation from file:/E:/apache-tomcat-8.0.21/webapps/UDMUI/WEB-INF/lib/ognl-3.0.6.jar]
[Loaded org.apache.jasper.compiler.Node$JspAttribute from file:/E:/apache-tomcat-8.0.21/lib/jasper.jar]
[Loaded java.util.Vector$ListItr from C:\Program Files\Java\jdk1.7.0_75\jre\lib\rt.jar]
[Loaded org.eclipse.jdt.internal.compiler.parser.RecoveryScanner from file:/E:/apache-tomcat-8.0.21/lib/ecj-4.4.2.jar]
[Loaded org.eclipse.jdt.internal.compiler.impl.CharConstant from file:/E:/apache-tomcat-8.0.21/lib/ecj-4.4.2.jar]
[Loaded org.eclipse.jdt.internal.compiler.impl.ByteConstant from file:/E:/apache-tomcat-8.0.21/lib/ecj-4.4.2.jar]
[Loaded org.eclipse.jdt.internal.compiler.ast.SynchronizedStatement from file:/E:/apache-tomcat-8.0.21/lib/ecj-4.4.2.jar]
[Loaded org.apache.jasper.compiler.JavacErrorDetail from file:/E:/apache-tomcat-8.0.21/lib/jasper.jar]
[Loaded org.apache.struts2.dispatcher.ActionContextCleanUp from file:/E:/apache-tomcat-8.0.21/webapps/UDMUI/WEB-INF/lib/struts2-core-2.3.20.jar]
Apr 08, 2015 3:51:27 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [jsp] in context with path [/UDMUI] threw exception [Unable to compile class for JSP: 

An error occurred at line: [43] in the generated java file: [E:\apache-tomcat-8.0.21\work\Catalina\localhost\UDMUI\org\apache\jsp\login\login_jsp.java]
The return type is incompatible with JspSourceDependent.getDependants()

An error occurred at line: [56] in the generated java file: [E:\apache-tomcat-8.0.21\work\Catalina\localhost\UDMUI\org\apache\jsp\login\login_jsp.java]
The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory

Stacktrace:] with root cause
org.apache.jasper.JasperException: Unable to compile class for JSP: 

An error occurred at line: [43] in the generated java file: [E:\apache-tomcat-8.0.21\work\Catalina\localhost\UDMUI\org\apache\jsp\login\login_jsp.java]
The return type is incompatible with JspSourceDependent.getDependants()

An error occurred at line: [56] in the generated java file: [E:\apache-tomcat-8.0.21\work\Catalina\localhost\UDMUI\org\apache\jsp\login\login_jsp.java]
The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory

Stacktrace:
    at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:102)
    at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:198)
    at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:450)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:361)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:336)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:323)
    at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:580)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:356)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:396)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:340)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:428)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
    at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:518)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1091)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:668)
    at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:223)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1517)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1474)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:745)

[Loaded org.apache.catalina.util.RequestUtil from file:/E:/apache-tomcat-8.0.21/lib/catalina.jar]
[Loaded java.util.Scanner from C:\Program Files\Java\jdk1.7.0_75\jre\lib\rt.jar]
[Loaded java.util.regex.Pattern$All from C:\Program Files\Java\jdk1.7.0_75\jre\lib\rt.jar]
[Loaded java.util.regex.Pattern$6 from C:\Program Files\Java\jdk1.7.0_75\jre\lib\rt.jar]
[Loaded sun.misc.LRUCache from C:\Program Files\Java\jdk1.7.0_75\jre\lib\rt.jar]
[Loaded java.util.Scanner$1 from C:\Program Files\Java\jdk1.7.0_75\jre\lib\rt.jar]
[Loaded org.apache.tomcat.util.http.ValuesEnumerator from file:/E:/apache-tomcat-8.0.21/lib/tomcat-coyote.jar]
[Loaded org.apache.tomcat.util.http.parser.AcceptLanguage from file:/E:/apache-tomcat-8.0.21/lib/tomcat-coyote.jar]
[Loaded sun.util.locale.LanguageTag from C:\Program Files\Java\jdk1.7.0_75\jre\lib\rt.jar]
[Loaded sun.util.locale.ParseStatus from C:\Program Files\Java\jdk1.7.0_75\jre\lib\rt.jar]
[Loaded sun.util.locale.StringTokenIterator from C:\Program Files\Java\jdk1.7.0_75\jre\lib\rt.jar]
[Loaded sun.util.locale.InternalLocaleBuilder from C:\Program Files\Java\jdk1.7.0_75\jre\lib\rt.jar]
[Loaded sun.util.locale.InternalLocaleBuilder$CaseInsensitiveChar from C:\Program Files\Java\jdk1.7.0_75\jre\lib\rt.jar]
[Loaded org.apache.catalina.util.ConcurrentDateFormat from file:/E:/apache-tomcat-8.0.21/lib/catalina.jar]
4

1 回答 1

0

如果包含 gwt-dev.jar 文件,请删除它。

我最近遇到了这个问题。当存在包含 JspFactory 定义的冲突 jar 时,往往会发生这种情况 -

类型 JspFactory 的方法 getJspApplicationContext(ServletContext) 未定义

使用 GWT,检查您是否包含 gwt-dev.jar 文件。它还包含 JSPFactory 的定义。这就是我遇到问题的原因。去掉它。您可能在运行时不需要它,也不需要包含 jar。

于 2015-05-11T18:58:26.497 回答