Friday, September 2, 2011

java.util.zip.ZipException

05:39:55,609 ERROR [ContainerBase] Servlet.service() for servlet jsp threw exception
java.util.zip.ZipException: invalid entry size (expected 2504523784 but got 4151 bytes)
at java.util.zip.ZipInputStream.readEnd(ZipInputStream.java:376)
at java.util.zip.ZipInputStream.read(ZipInputStream.java:148)
at java.util.jar.JarInputStream.read(JarInputStream.java:177)
at java.util.zip.ZipInputStream.closeEntry(ZipInputStream.java:92)
at java.util.zip.ZipInputStream.getNextEntry(ZipInputStream.java:70)
at java.util.jar.JarInputStream.getNextEntry(JarInputStream.java:118)
at java.util.jar.JarInputStream.getNextJarEntry(JarInputStream.java:149)
at org.jboss.web.tomcat.service.jasper.TagLibCache.scanJar(TagLibCache.java:324)
at org.jboss.web.tomcat.service.jasper.TagLibCache.processTldsInFileSystem(TagLibCache.java:268)
at org.jboss.web.tomcat.service.jasper.TagLibCache.processTldsInFileSystem(TagLibCache.java:261)
at org.jboss.web.tomcat.service.jasper.TagLibCache.init(TagLibCache.java:101)


This error looks like it is having trouble reading a jar file while looking for a tld. Hence you need to check the files in the WEB-INF/lib directory to make sure they are all valid jar files. Also it may occurs when text file entries in the source jar file contain some non-ASCII characters such as ^I ^Z ^D ^C.