关于码头9.3.3的JSP编译错误 [英] JSP compilation error on jetty-9.3.3

查看:85
本文介绍了关于码头9.3.3的JSP编译错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个运行在嵌入式Jetty-7.6.8(jdk-6)上的webapp应用程序,但是由于浏览器上的Diffe-Hellman错误,我们决定使用较新版本的Jetty.因此,我们移至Jetty-9.3.3.由于Jetty-9.x需要jdk-8,所以我也升级了jdk.现在,jetty正在启动,没有错误,但是当我尝试访问登录页面时,出现无法编译的jsp错误.

I have a webapp application which was running on embedded Jetty-7.6.8 (jdk-6), but due to Diffe-Hellman error on the browser we decided to move to newer version of Jetty. So, we moved to Jetty-9.3.3. As Jetty-9.x needs jdk-8, I upgraded jdk also. Right now jetty is starting up with no error but when I try to access my login page I get an unable compile jsp error.

这些是依赖项:

-org.eclipse.jetty.apache-jsp-9.3.3.v20150827.jar
-org.mortbay.jasper.apache-el-8.0.23.M1.jar 
-org.mortbay.jasper.apache-jsp-8.0.23.M1.jar
-org.eclipse.jetty.orbit.org.eclipse.jdt.core-3.8.2.v20130121.jar
-jetty-continuation-9.3.3.v20150827.jar 
-jetty-http-9.3.3.v20150827.jar
-jetty-io-9.3.3.v20150827.jar 
-jetty-security-9.3.3.v20150827.jar
-jetty-server-9.3.3.v20150827.jar 
-jetty-servlet-9.3.3.v20150827.jar
-jetty-util-9.3.3.v20150827.jar 
-jetty-webapp-9.3.3.v20150827.jar
-jetty-xml-9.3.3.v20150827.jar
-servlet-api-3.1.jar

日志/浏览器上的错误:

The error which comes on the log/browser:

HTTP ERROR 500

Problem accessing /xdadm/test.jsp. Reason:

Server Error

Caused by:

org.apache.jasper.JasperException: Unable to compile class for JSP
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:600)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:363)
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:790)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:816)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1686)
at com.xcom.filter.RequestHandler.doFilter(RequestHandler.java:91)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:581)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1156)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1088)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:213)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:119)
at org.eclipse.jetty.server.Server.handle(Server.java:517)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:306)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:242)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:245)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
at org.eclipse.jetty.io.ssl.SslConnection.onFillable(SslConnection.java:192)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:245)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:75)
at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceAndRun(ExecuteProduceConsume.java:213)
at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:147)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:654)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:572)
at java.lang.Thread.run(Thread.java:745)

Caused by: java.lang.NullPointerException
at org.apache.jasper.compiler.Validator$ValidateVisitor.<init>(Validator.java:515)
at org.apache.jasper.compiler.Validator.validateExDirectives(Validator.java:1853)
at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:217)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:356)
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:585)
... 33 more

请提供有关发生问题的任何线索或建议. TIA

Please, any clue or suggestion on what's going wrong. TIA

推荐答案

Embedded Jetty Server 9.4.15和JSP支持存在相同的问题. 解决方案非常简单: https://www.eclipse.org/jetty/documentation/current/embedded-examples.html#embedded-webapp-jsp

I had the same problem with Embedded Jetty Server 9.4.15 and JSP support. The solution is pretty simple : https://www.eclipse.org/jetty/documentation/current/embedded-examples.html#embedded-webapp-jsp

您必须启用AnnotationConfiguration:

You have to enable AnnotationConfiguration :

// This webapp will use jsps and jstl. We need to enable the
// AnnotationConfiguration in order to correctly
// set up the jsp container
Configuration.ClassList classlist = Configuration.ClassList
            .setServerDefault( server );
classlist.addBefore(
            "org.eclipse.jetty.webapp.JettyWebXmlConfiguration",
            "org.eclipse.jetty.annotations.AnnotationConfiguration" );

这篇关于关于码头9.3.3的JSP编译错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆