"org.apache.jasper.JasperException" 在码头访问 JSP 时

"org.apache.jasper.JasperException" while accessing JSPs in jetty

我正在尝试 运行 一个在 Jetty 中带有 JSPs 的网络应用程序。我为 JSP 支持添加了以下依赖项。

1)javax.servlet.jsp-2.2.0.v201112011158.jar
2)org.apache.jasper.glassfish-2.2.2.v201112011158.jar
3)javax.el-api-3.0.0.jar@star
4)javax.el-2.2.0.v201303151357.jar
5)org.eclipse.jetty.orbit.org.eclipse.jdt.core-3.8.2.v20130121.jar

然而,在访问 JSP 之一时,我遇到了以下异常:

HTTP ERROR 500

Problem accessing /ui/servletcontext.jsp. Reason:

    Server Error
Caused by:

org.apache.jasper.JasperException: PWC6033: Error in Javac compilation for JSP

PWC6199: Generated servlet error:
org.apache.jasper.runtime.HttpJspBase cannot be resolved to a type

PWC6199: Generated servlet error:
org.apache.jasper.runtime.JspSourceDependent cannot be resolved to a type

PWC6199: Generated servlet error:
JspFactory cannot be resolved to a type

PWC6199: Generated servlet error:
JspFactory cannot be resolved

PWC6199: Generated servlet error:
org.glassfish.jsp.api.ResourceInjector cannot be resolved to a type

PWC6199: Generated servlet error:
PageContext cannot be resolved to a type

PWC6199: Generated servlet error:
JspWriter cannot be resolved to a type

PWC6199: Generated servlet error:
JspWriter cannot be resolved to a type

PWC6199: Generated servlet error:
PageContext cannot be resolved to a type

PWC6199: Generated servlet error:
_jspxFactory cannot be resolved

PWC6199: Generated servlet error:
_jspx_resourceInjector cannot be resolved to a variable

PWC6199: Generated servlet error:
org.glassfish.jsp.api.ResourceInjector cannot be resolved to a type

PWC6199: Generated servlet error:
SkipPageException cannot be resolved to a type

PWC6199: Generated servlet error:
_jspxFactory cannot be resolved


    at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:129)
    at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:299)
    at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:392)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:453)
    at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:625)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:492)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:378)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:669)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:457)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
    at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:557)
    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1075)
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:384)
    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1009)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
    at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:255)
    at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
    at org.eclipse.jetty.server.Server.handle(Server.java:368)
    at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:489)
    at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:942)
    at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1004)
    at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:640)
    at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
    at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:628)
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:52)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.run(QueuedThreadPool.java:543)
    at java.lang.Thread.run(Thread.java:745)

我已经查看了很多论坛以查看问题出在哪里,但找不到任何答案。请帮忙。

在嵌入式 Jetty 中设置 JSP 需要的步骤比仅将 类 添加到类路径要多得多。

JSP 环境也需要设置/配置。

这在

的过去答案中有详细说明