我正在Eclipse中的Jetty服务器上运行war应用程序。当我尝试打开主JSP页面时,我收到以下错误消息。注意:我使用的是Java 8,在我们的战争中打包的编译器是抛出异常的:org.apache.jasper_5.5.17.v201101211617.jar。任何帮助表示赞赏谢谢。
例外:
HTTP ERROR 500
Problem accessing /help/updater/updatewar.jsp. Reason:
Unable to compile class for JSP
An error occurred at line: 16 in the jsp file: /updater/updatewar.jsp
Generated servlet error:
The type java.lang.CharSequence cannot be resolved. It is indirectly referenced from required .class files
Caused by:
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 16 in the jsp file: /updater/updatewar.jsp
Generated servlet error:
The type java.lang.CharSequence cannot be resolved. It is indirectly referenced from required .class files
at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:328)
at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:414)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:297)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:276)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:264)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:563)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:303)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
at org.eclipse.equinox.jsp.jasper.JspServlet.service(JspServlet.java:153)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
at org.eclipse.equinox.http.registry.internal.ServletManager$ServletWrapper.service(ServletManager.java:180)
at org.eclipse.equinox.http.servlet.internal.ServletRegistration.service(ServletRegistration.java:61)
at org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:126)
at org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:68)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
at org.eclipse.equinox.servletbridge.BridgeServlet.service(BridgeServlet.java:120)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:598)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1367)
at com.ibm.ccl.ut.war.filter.WelcomeFileFilter.doFilter(WelcomeFileFilter.java:51)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1338)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:484)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:524)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:233)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1065)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:413)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:192)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:999)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111)
at org.eclipse.jetty.server.Server.handle(Server.java:350)
at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:454)
at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:890)
at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:944)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:630)
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:230)
at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:77)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:606)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:46)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:603)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:538)
at java.lang.Thread.run(Thread.java:785)
答案 0 :(得分:1)
Jetty 7(及更低版本)可能不支持Java 8.在Java 8中,对类进行了一些更改,导致JSP编译失败。
ManifoldCF中的相关问题(相同的例外):https://issues.apache.org/jira/browse/CONNECTORS-938
至少Jetty 9.2支持Java 8:https://webtide.com/jetty-9-2-0-released/ http://www.eclipse.org/jetty/documentation/current/what-jetty-version.html
答案 1 :(得分:0)
在jrxml中添加just language =“groovy”对我有用。
<jasperReport
xmlns="http://jasperreports.sourceforge.net/jasperreports"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd"
name="jasper_report_template" **language="groovy"**
pageWidth="100" pageHeight="100" columnWidth="10"
leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20"
>
答案 2 :(得分:0)
正如所有人所说只是升级码头服务器
如果您正在使用maven
转到jetty插件并将其更新为
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>9.3.0.v20150612</version>
<configuration>
<scanIntervalSeconds>3</scanIntervalSeconds>
<httpConnector>
<port>${jetty.port}</port>
<idleTimeout>60000</idleTimeout>
</httpConnector>
<stopKey>foo</stopKey>
<stopPort>${jetty.stop.port}</stopPort>
</configuration>
</plugin>