无法读取 TLD“META-INF/stripes.tld”来自 JAR 文件错误
在将我们的 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这实际上需要一段时间才能追查,因为错误消息并不完全反映实际问题是什么,但简而言之,这是一个类似的听起来错误(即“无法从 JAR 中读取 TLD“META-INF/*.tld”)文件”)似乎是在您部署的 JAR 文件与 Tomcat 本身部署的 JAR 文件之间存在类冲突时发生的。事实证明我的错误就是这种情况,因为有两个文件(javax.servlet.jsp-api-2.2.1.jar 和 el-api-1.0.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: