无法读取 TLD“META-INF/stripes.tld”来自 JAR 文件错误

发布于 2024-12-06 20:59:20 字数 2464 浏览 0 评论 0原文

在将我们的 Web 应用程序重大升级到 ivy 进行构建管理后,我遇到了一些不寻常的错误,其中还包括更新所有涉及的主要库。虽然我们设法通过单元测试,但当我们将 Web 应用程序部署到 Tomcat 并尝试在浏览器中导航到它时,我们收到以下错误:

org.apache.jasper.JasperException: /index.jsp(1,1) /layout/taglibs.jsp(2,77) 无法读取 TLD“META-INF/stripes.tld” 来自 JAR 文件 “文件:/Library/Tomcat/apache-tomcat-6.0.32/webapps/cga/WEB-INF/lib/stripes-1.5.6.jar”: org.apache.jasper.JasperException:无法加载或实例化 TagExtraInfo 类:net.sourceforge.stripes.tag.ErrorsTagExtraInfo

我已经检查了常见问题并验证了 jar 文件是否位于正确的位置、tld 文件是否存在于 jar 中,等等。同样,搜索错误仅显示有限数量的返回,主要与具有相同错误的邮件列表问题相关。我已经阅读了那篇文章,也尝试了这些解决方案,但运气不佳。

关于可能导致此错误的原因有什么想法吗?

我收到的完整错误跟踪如下:

org.apache.jasper.JasperException: /index.jsp(1,1) /layout/taglibs.jsp(2,77) Unable to read TLD "META-INF/stripes.tld" from JAR file "file:/Library/Tomcat/apache-tomcat-6.0.32/webapps/cga/WEB-INF/lib/stripes-1.5.6.jar": org.apache.jasper.JasperException: Failed to load or instantiate TagExtraInfo class: net.sourceforge.stripes.tag.ErrorsTagExtraInfo
    org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
    org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
    org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:88)
    org.apache.jasper.compiler.Parser.processIncludeDirective(Parser.java:300)
    org.apache.jasper.compiler.Parser.parseIncludeDirective(Parser.java:333)
    org.apache.jasper.compiler.Parser.parseDirective(Parser.java:442)
    org.apache.jasper.compiler.Parser.parseElements(Parser.java:1397)
    org.apache.jasper.compiler.Parser.parse(Parser.java:130)
    org.apache.jasper.compiler.ParserController.doParse(ParserController.java:255)
    org.apache.jasper.compiler.ParserController.parse(ParserController.java:103)
    org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:185)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:347)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:327)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:314)
    org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:592)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:326)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

I'm encountering a bit of an unusual error after a major upgrade of our web application to ivy for build management which also included updating all of the major libraries involved as well. While we are managing to pass our unit tests, when we deploy the web application to Tomcat and try to navigate to it in the brower we get the following error:

org.apache.jasper.JasperException: /index.jsp(1,1)
/layout/taglibs.jsp(2,77) Unable to read TLD "META-INF/stripes.tld"
from JAR file
"file:/Library/Tomcat/apache-tomcat-6.0.32/webapps/cga/WEB-INF/lib/stripes-1.5.6.jar":
org.apache.jasper.JasperException: Failed to load or instantiate
TagExtraInfo class: net.sourceforge.stripes.tag.ErrorsTagExtraInfo

I've checked the usual suspects and verified that the jar file is in the correct location, that the tld file is present in the jar, and so forth. Likewise, searching for the error shows only a limited number of returns, primarily related to a mailing list question with the same error. I've gone through that post and also tried those solutions with not much luck.

Any ideas as to what might be causing this error?

The full error trace that I'm receiving is as follows:

org.apache.jasper.JasperException: /index.jsp(1,1) /layout/taglibs.jsp(2,77) Unable to read TLD "META-INF/stripes.tld" from JAR file "file:/Library/Tomcat/apache-tomcat-6.0.32/webapps/cga/WEB-INF/lib/stripes-1.5.6.jar": org.apache.jasper.JasperException: Failed to load or instantiate TagExtraInfo class: net.sourceforge.stripes.tag.ErrorsTagExtraInfo
    org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
    org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
    org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:88)
    org.apache.jasper.compiler.Parser.processIncludeDirective(Parser.java:300)
    org.apache.jasper.compiler.Parser.parseIncludeDirective(Parser.java:333)
    org.apache.jasper.compiler.Parser.parseDirective(Parser.java:442)
    org.apache.jasper.compiler.Parser.parseElements(Parser.java:1397)
    org.apache.jasper.compiler.Parser.parse(Parser.java:130)
    org.apache.jasper.compiler.ParserController.doParse(ParserController.java:255)
    org.apache.jasper.compiler.ParserController.parse(ParserController.java:103)
    org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:185)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:347)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:327)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:314)
    org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:592)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:326)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

笑,眼淚并存 2024-12-13 20:59:20

这实际上需要一段时间才能追查,因为错误消息并不完全反映实际问题是什么,但简而言之,这是一个类似的听起来错误(即“无法从 JAR 中读取 TLD“META-INF/*.tld”)文件”)似乎是在您部署的 JAR 文件与 Tomcat 本身部署的 JAR 文件之间存在类冲突时发生的。事实证明我的错误就是这种情况,因为有两个文件(javax.servlet.jsp-api-2.2.1.jar 和 el-api-1.0.jar)存在冲突。

由于此问题似乎经常出现,因此这里有一些故障排除提示:

  • 仔细检查您正在部署的内容,以确保没有意外情况,如果您使用依赖项管理器,请确保依赖项的依赖项不会导致您出现问题。问题。
  • 仔细检查以确保您已清除以前版本中的所有内容并再次部署,令人惊讶的是,这多次让我感到沮丧。
  • 不要将 servlet-api.jar 直接包含在您自己的库中,而是使用带有可变路径的外部 JAR - 指南
  • 不要期望 JAR 文件按照您的预期命名,或者它们不包含您认为它们不会包含的内容,如果必须的话,请打开它们以仔细检查内容。

This actually took awhile to chase down as the error message is not entirely reflective of what the actual problem is, but in a nut shell this an similar sounding errors (i.e. "Unable to read TLD “META-INF/*.tld” from JAR file") seem to occur when there is a class conflict between one the JAR files that you have deployed and what is deployed with Tomcat itself. This turned out to be the case for my error as there were two files in place (javax.servlet.jsp-api-2.2.1.jar and el-api-1.0.jar) that were conflicting.

As this issue seems to popup quite a bit, here are a couple troubleshooting tips:

  • Double check what you are deploying to make sure there is nothing unexpected, if you are using a dependency manager make sure the dependency of a dependency isn't causing you problems.
  • Double check to make sure you have cleared everything out of previous version and deploy again, surprisingly this caught me more than once causing some frustration.
  • Don't include servlet-api.jar directly in your own lib but rather use an external JAR with a variable path - guide.
  • Don't expect JAR files to be named as you expect or for them to not contain something you don't think they would have, if you have to, open them up to double check the contents.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文