我有一个由我的一些同学开发的OSGi应用程序,我尝试在OS X 10.8下使用Java 1.6在Eclipse Juno 4.2中运行它。该应用程序的一个捆绑包负责使用JSP和Jetty提供Web界面。当我尝试在Eclipse中运行项目时,当我尝试访问Web界面时,Equinox控制台给出了以下异常:
2012-08-21 16:15:30.574:WARN:oejs.ServletHandler:/ner/ner
org.apache.jasper.JasperException: /WEB-INF/ner.jsp(5,68) PWC6226: Could not add one or more tag libraries.
at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:81)
at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:376)
at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:133)
at org.apache.jasper.compiler.JspDocumentParser.parse(JspDocumentParser.java:258)
at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:229)
at org.apache.jasper.compiler.ParserController.parse(ParserController.java:145)
at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:212)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
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.equinox.jsp.jasper.JspServlet.service(JspServlet.java:155)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
at org.eclipse.equinox.http.servlet.internal.ServletRegistration.service(ServletRegistration.java:61)
at org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:128)
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.http.jetty.internal.HttpServerManager$InternalHttpServiceServlet.service(HttpServerManager.java:384)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:598)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:486)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
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.Dispatcher.forward(Dispatcher.java:271)
at org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:98)
at org.eclipse.equinox.http.servlet.internal.RequestDispatcherAdaptor.forward(RequestDispatcherAdaptor.java:30)
at de.uni_sb.coli.nep.webui.NerServlet.doGet(NerServlet.java:150)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:735)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
at org.eclipse.equinox.http.servlet.internal.ServletRegistration.service(ServletRegistration.java:61)
at org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:128)
at org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:60)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
at org.eclipse.equinox.http.jetty.internal.HttpServerManager$InternalHttpServiceServlet.service(HttpServerManager.java:384)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:598)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:486)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
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:722)
与Web界面相关的文件夹结构如下:
WebContent
|----> WEB-INF
|----> ner.jsp # This is the template
lib
|----> commons-fileupload-1.2.2.jar
commons-io-2.0.1.jar
tld
|----> c-1_0-rt.tld
c-1_0.tld
c.tld
fmt-1_0-rt.tld
fmt-1_0.tld
fmt.tld
fn.tld
permittedTaglibs.tld
scriptfree.tld
sql-1_0-rt.tld
sql-1_0.tld
sql.tld
x-1_0-rt.tld
x-1_0.tld
x.tld
Web界面应该可以在http://localhost:8080/ner/ner
访问,但Jetty只给我一个HTTP 500,其例外情况与上述相同。在终端中,一切都很好但不是在Eclipse中。似乎Eclipse期待不同的文件夹结构或其他东西。
你知道什么可能导致这个问题吗?如果您需要查看某些文件的内容,请告诉我,我会将它们添加到此帖子中。非常感谢提前!
答案 0 :(得分:0)
我发现这个错误是皇家PITA - 不幸的是它可能来自多个来源。对于几种不同的情况,错误消息似乎都是一个问题。
首先,您需要确保您在war文件中使用的库全部"正确对齐"。我发现这个问题得到了最好的回答in this question。
但这仍然可能无法解决问题 - 它不在这里!因此,如果您有自己的标记库并使用保留字,那么这似乎也会导致错误。
例如:
<jsp:directive.attribute
name="minimize"
type="java.lang.Boolean"
required="true"
description="Compress something"/>
在这种情况下&#34;最小化&#34;导致冲突,可以通过此错误消息报告。