gpt4 book ai didi

java - 组织.apache.jasper.JasperException : Could not add one or more tag libraries

转载 作者:行者123 更新时间:2023-11-29 09:11:36 26 4
gpt4 key购买 nike

我有一个由我的一些同学开发的 OSGi 应用程序,我试图让它在 OS X 10.8 下的 Eclipse Juno 4.2 和 Java 1.6 中运行。该应用程序的一个包负责使用 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,但与上面所述的异常(exception)情况相同。在终端中,一切正常,但在 Eclipse 中却不行。似乎 Eclipse 需要不同的文件夹结构或其他东西。

您知道是什么导致了这个问题吗?如果您需要查看某些文件的内容,请告诉我,我会将它们添加到这篇文章中。非常感谢!

最佳答案

我发现这个错误是皇家 PITA - 不幸的是它可能来自多个来源。对于几种不同的情况,错误消息似乎有点笼统。

首先,您需要确保您在 war 文件中使用的库都“正确对齐”。我发现这个问题最好回答 in this question .

虽然这仍然可能无法解决问题 - 它不在这里!因此,如果您有自己的标签库并使用保留字,那似乎也会导致错误。

例如:

    <jsp:directive.attribute
name="minimize"
type="java.lang.Boolean"
required="true"
description="Compress something"/>

在这种情况下,“最小化”会导致冲突,并且可以通过此错误消息进行报告。

关于java - 组织.apache.jasper.JasperException : Could not add one or more tag libraries,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12062851/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com