时间:2011-09-14 14:39:34

标签: java jboss

我正在使用jboss-5.1.0.GA和j2sdk1.4.2_06。

我的应用程序已成功部署,但在浏览应用程序时收到错误。

http://localhost:8080/esm/

给出以下错误,请帮助。

org.apache.jasper.JasperException: Unable to initialize TldLocationsCache: java.util.zip.ZipException: invalid entry CRC (expected 0x47d80677 but got 0x7815789e)
    org.jboss.web.tomcat.service.jasper.TagLibCache.init(TagLibCache.java:106)
    org.jboss.web.tomcat.service.jasper.TagLibCache.getLocation(TagLibCache.java:83)
    org.apache.jasper.JspCompilationContext.getTldLocation(JspCompilationContext.java:549)
    org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:428)
    org.apache.jasper.compiler.Parser.parseDirective(Parser.java:491)
    org.apache.jasper.compiler.Parser.parseElements(Parser.java:1438)
    org.apache.jasper.compiler.Parser.parse(Parser.java:137)
    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:171)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:333)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:313)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:300)
    org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:585)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:312)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:322)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:249)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)


root cause 

org.apache.jasper.JasperException: java.util.zip.ZipException: invalid entry CRC (expected 0x47d80677 but got 0x7815789e)
    org.jboss.web.tomcat.service.jasper.TagLibCache.scanJar(TagLibCache.java:343)
    org.jboss.web.tomcat.service.jasper.TagLibCache.processTldsInFileSystem(TagLibCache.java:268)
    org.jboss.web.tomcat.service.jasper.TagLibCache.processTldsInFileSystem(TagLibCache.java:261)
    org.jboss.web.tomcat.service.jasper.TagLibCache.init(TagLibCache.java:101)
    org.jboss.web.tomcat.service.jasper.TagLibCache.getLocation(TagLibCache.java:83)
    org.apache.jasper.JspCompilationContext.getTldLocation(JspCompilationContext.java:549)
    org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:428)
    org.apache.jasper.compiler.Parser.parseDirective(Parser.java:491)
    org.apache.jasper.compiler.Parser.parseElements(Parser.java:1438)
    org.apache.jasper.compiler.Parser.parse(Parser.java:137)
    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:171)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:333)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:313)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:300)
    org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:585)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:312)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:322)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:249)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
root cause 
java.util.zip.ZipException: invalid entry CRC (expected 0x47d80677 but got 0x7815789e)
    java.util.zip.ZipInputStream.readEnd(ZipInputStream.java:381)
    java.util.zip.ZipInputStream.read(ZipInputStream.java:148)
    java.util.jar.JarInputStream.read(JarInputStream.java:177)
    java.util.zip.ZipInputStream.closeEntry(ZipInputStream.java:92)
    java.util.zip.ZipInputStream.getNextEntry(ZipInputStream.java:70)
    java.util.jar.JarInputStream.getNextEntry(JarInputStream.java:118)
    java.util.jar.JarInputStream.getNextJarEntry(JarInputStream.java:149)
    org.jboss.web.tomcat.service.jasper.TagLibCache.scanJar(TagLibCache.java:324)
    org.jboss.web.tomcat.service.jasper.TagLibCache.processTldsInFileSystem(TagLibCache.java:268)
    org.jboss.web.tomcat.service.jasper.TagLibCache.processTldsInFileSystem(TagLibCache.java:261)
    org.jboss.web.tomcat.service.jasper.TagLibCache.init(TagLibCache.java:101)
    org.jboss.web.tomcat.service.jasper.TagLibCache.getLocation(TagLibCache.java:83)
    org.apache.jasper.JspCompilationContext.getTldLocation(JspCompilationContext.java:549)
    org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:428)
    org.apache.jasper.compiler.Parser.parseDirective(Parser.java:491)
    org.apache.jasper.compiler.Parser.parseElements(Parser.java:1438)
    org.apache.jasper.compiler.Parser.parse(Parser.java:137)
    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:171)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:333)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:313)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:300)
    org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:585)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:312)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:322)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:249)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

感谢回答,但即使添加后,我也会收到错误。

  

org.apache.jasper.JasperException:无法为JSP编译类:

     

生成的java文件中的第54行发生错误   对于JspFactory类型,未定义getJspApplicationContext(ServletContext)方法

     

生成的java文件中的行:177发生错误   mainMenu_jsp类型中的方法_jspx_meth_bean_005fmessage_005f1(JspTag,PageContext)不适用于参数(FormTag,PageContext)

2 个答案:

答案 0 :(得分:1)

需要添加jboss5 default/deployers/jboss.deployer/web.xml

<init-param>
   <param-name>engineOptionsClass</param-name>
   <param-value>
      org.jboss.web.tomcat.service.jasper.JspServletOptions</param-value>
</init-param>
添加

<init-param> <param-name>engineOptionsClass</param-name>
    <param-value>org.jboss.web.tomcat.tc5.jasper.JspServletOptions
    </param-value> 
</init-param>

答案 1 :(得分:1)

web-inf/lib中的我的Jar文件已损坏。

所以得到了例外:

org.apache.jasper.JasperException: Unable to initialize TldLocationsCache: java.util.zip.ZipException: invalid entry CRC (expected 0x47d80677 but got 0x7815789e) 

解决这个问题:

尝试提取( -xvf )或列出( -tf web-inf/lib中的所有广告。

任何在列出或提取时给出zip异常的jar都是损坏的。