3 Replies Latest reply on Sep 25, 2008 11:17 AM by Chris Langevin

    Error in reloading jsp with taglib directive

    Qaisar Iqbal Newbie

      Hi,

      Can anyone help me with a strange issue.

      I have a simple jsp with a taglib directive.

      <%@ taglib uri = "WEB-INF/myTaglib.tld" prefix = "output" %>
      <html>
      <body>
      Hello
      </body>
      </html>


      I saved the taglib at:
      \jboss-4.0.3\server\default\deploy\myApp.war\WEB-INF

      I saved the jsp at the root of my web application, so it is accessible as:
      http://localhost:8080/myApp/myJsp.jsp

      Whenever i make the slighest change in this jsp and restart my jboss server, it gives an error. The strangest thing is that the error comes only once. Even if i simply refresh the page, its gone. It only happens once when I make changes and restart the server at the same time.
      The exception thrown is:

      10:47:50,609 ERROR [[jsp]] Servlet.service() for servlet jsp threw exception
      java.util.zip.ZipException: invalid entry size (expected 2683 but got 2686 bytes)
       at java.util.zip.ZipInputStream.readEnd(ZipInputStream.java:368)
       at java.util.zip.ZipInputStream.read(ZipInputStream.java:141)
       at java.util.jar.JarInputStream.read(JarInputStream.java:171)
       at java.util.zip.ZipInputStream.closeEntry(ZipInputStream.java:91)
       at java.util.zip.ZipInputStream.getNextEntry(ZipInputStream.java:69)
       at java.util.jar.JarInputStream.getNextEntry(JarInputStream.java:118)
       at java.util.jar.JarInputStream.getNextJarEntry(JarInputStream.java:149)
       at org.jboss.web.tomcat.tc5.jasper.TagLibCache.scanJar(TagLibCache.java:319)
       at org.jboss.web.tomcat.tc5.jasper.TagLibCache.processTldsInFileSystem(TagLibCache.java:263)
       at org.jboss.web.tomcat.tc5.jasper.TagLibCache.processTldsInFileSystem(TagLibCache.java:256)
       at org.jboss.web.tomcat.tc5.jasper.TagLibCache.init(TagLibCache.java:100)
       at org.jboss.web.tomcat.tc5.jasper.TagLibCache.getLocation(TagLibCache.java:88)
       at org.apache.jasper.JspCompilationContext.getTldLocation(JspCompilationContext.java:519)
       at org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:417)
       at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:483)
       at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1543)
       at org.apache.jasper.compiler.Parser.parse(Parser.java:126)
       at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:211)
       at org.apache.jasper.compiler.ParserController.parse(ParserController.java:100)
       at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:146)
       at org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
       at org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)
       at org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)
       at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:556)
       at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:293)
       at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
       at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      

      Please note the error in bold. It is coming due to taglib directive.

      I tried following things and it worked
      1> Make changes in jsp but do not restart server
      2> Restart server but no changes in jsp
      3> Simply refresh the page after first access

      Please someone help me, it is most urgent.

      Thanks in advance

      Qaisar Iqbal
      qiqbal@folio3.com
      Sr. Software Engineer
      Folio3 Pvt. Ltd.
      Karachi, Pakistan
      www.folio3.com

        • 1. Re: Error in reloading jsp with taglib directive
          Christof Heidrich Newbie

          Hi Qaisar ,

          I got exactly the same ZipException like you when using JBOSS in combination with custom tagLibs in JSP's.

          Since I have to solve the same problem could you send me a solution if available? My business adress is christof.heidrich@dkib.com.

          Thanks in advance,

          Christof


          • 2. Re: Error in reloading jsp with taglib directive
            Gregor Rosenauer Newbie

            Glad I am not alone with this... I get the same error here, with the following taglibs (as you can see this is a Struts-webapp):

            <%@ taglib uri="/WEB-INF/tld/struts-html.tld" prefix="html"%>
            <%@ taglib uri="/WEB-INF/tld/struts-bean.tld" prefix="bean"%>

            I am on Java 1.4.2 and JBoss 4.0.4.GA_p1 (also tried 4.0.4.GA and 4.0.3SP1):
            org.apache.jasper.JasperException: Unable to initialize TldLocationsCache: Unexpected end of ZLIB input stream
             org.jboss.web.tomcat.tc5.jasper.TagLibCache.init(TagLibCache.java:105)
             org.jboss.web.tomcat.tc5.jasper.TagLibCache.getLocation(TagLibCache.java:88)
             org.apache.jasper.JspCompilationContext.getTldLocation(JspCompilationContext.java:519)
             org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:417)
             org.apache.jasper.compiler.Parser.parseDirective(Parser.java:483)
             org.apache.jasper.compiler.Parser.parseElements(Parser.java:1543)
             org.apache.jasper.compiler.Parser.parse(Parser.java:126)
            ...

            Root cause:
            org.apache.jasper.JasperException: Unexpected end of ZLIB input stream
             org.jboss.web.tomcat.tc5.jasper.TagLibCache.scanJar(TagLibCache.java:338)
             org.jboss.web.tomcat.tc5.jasper.TagLibCache.processTldsInFileSystem(TagLibCache.java:263)
             org.jboss.web.tomcat.tc5.jasper.TagLibCache.processTldsInFileSystem(TagLibCache.java:256)
             org.jboss.web.tomcat.tc5.jasper.TagLibCache.init(TagLibCache.java:100)
             org.jboss.web.tomcat.tc5.jasper.TagLibCache.getLocation(TagLibCache.java:88)
             org.apache.jasper.JspCompilationContext.getTldLocation(JspCompilationContext.java:519)
             org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:417)
             org.apache.jasper.compiler.Parser.parseDirective(Parser.java:483)
             org.apache.jasper.compiler.Parser.parseElements(Parser.java:1543)
             org.apache.jasper.compiler.Parser.parse(Parser.java:126)
            ...

            This has to be a configuration/installation-issue as my colleague could not reproduce this error yet on his (similar) setup. I will post any helpful input here, in the meantime I am grateful for any inspiration...

            PS: The files are perfectly readable and I doublechecked the jsf-jars in \jbossweb-tomcat55.sar\jsf-libs

            • 3. Re: Error in reloading jsp with taglib directive
              Chris Langevin Newbie

              I have now encountered this same situation with my app on JBoss 4.2.3. Were you ever able to find a resolution to this?

              Chris