weixin_42344646
2009-08-31 10:36
浏览 368
已采纳

Unable to read TLD "META-INF/taglib.tld"

I got an error when using tomcat,the below are the details.And I
looked over the source of jaser and found [location[1] =
"META-INF/taglib.tld";] in the
org.apache.jasper.compiler.TagLibraryInfoImpl.java and
TagPluginManager.java.I want to know how to solve it and why??
Thanks.
---------------my web.xml


/struts-tags
/WEB-INF/lib/struts2-core-2.1.6.jar

There is only struts-tag.tld in the struts2-core-2.1.6.jar.

Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: Unable to read TLD "META-INF/taglib.tld"
from JAR file
"file:/X:/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/AccountMgr/WEB-INF/lib/struts2-core-2.1.6.jar":
java.lang.NullPointerException
at
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:51)
at
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409)
at
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:181)
at
org.apache.jasper.compiler.TagLibraryInfoImpl.(TagLibraryInfoImpl.java:182)
at org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:429)
at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:492)
at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1439)
at org.apache.jasper.compiler.Parser.parse(Parser.java:137)
at
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:255)
at
org.apache.jasper.compiler.ParserController.parse(ParserController.java:103)
at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:170)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:332)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:312)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:299)
at
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:586)
at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:389)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
at java.lang.Thread.run(Thread.java:620)

  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

2条回答 默认 最新

  • walsh_bupt 2009-08-31 10:48
    已采纳

    在你的Web.xml去除下边的配置。
    [quote]

    /struts-tags
    /WEB-INF/lib/struts2-core-2.1.6.jar

    [/quote]

    如果在你的JSP页面中需要Struts2的标签,只需要在JSP页面中引入:
    [code="java"]<%@ taglib prefix="s" uri="/struts-tags"%>[/code]

    如果在你的JSP页面中既有EL表达式,又有Struts2的标签,那么直接在struts2里使用原el是不行的,如果想使用原EL的话可以通过配置使用

    打赏 评论
  • wanghaolovezlq 2009-08-31 11:02

    这段设置是可以不用的



    /struts-tags
    /WEB-INF/lib/struts2-core-2.1.6.jar

    打赏 评论

相关推荐 更多相似问题