Bug 57887 - IllegalStateException: zip file closed
IllegalStateException: zip file closed
Status: RESOLVED FIXED
Product: Tomcat 8
Classification: Unclassified
Component: Jasper
8.0.21
PC Linux
: P2 normal (vote)
: ----
Assigned To: Tomcat Developers Mailing List
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2015-05-04 21:26 UTC by Rafael Mattos
Modified: 2015-05-06 14:47 UTC (History)
0 users



Attachments
test case (366.50 KB, application/zip)
2015-05-05 16:37 UTC, Rafael Mattos
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rafael Mattos 2015-05-04 21:26:32 UTC
When reading a JSP thats inside a JAR, tomcat throws a IllegalStateException: zip file closed

Stacktrace:


java.lang.IllegalStateException: zip file closed
	at java.util.zip.ZipFile.ensureOpen(ZipFile.java:670)
	at java.util.zip.ZipFile.getEntry(ZipFile.java:310)
	at java.util.jar.JarFile.getEntry(JarFile.java:240)
	at org.apache.tomcat.util.scan.JarFileUrlJar.getLastModified(JarFileUrlJar.java:87)
	at org.apache.jasper.JspCompilationContext.getLastModified(JspCompilationContext.java:368)
	at org.apache.jasper.JspCompilationContext.getLastModified(JspCompilationContext.java:356)
	at org.apache.jasper.compiler.Compiler.compile(Compiler.java:358)
	at org.apache.jasper.compiler.Compiler.compile(Compiler.java:336)
	at org.apache.jasper.compiler.Compiler.compile(Compiler.java:323)
	at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:580)
	at org.apache.jasper.servlet.JspServletWrapper.loadTagFile(JspServletWrapper.java:239)
	at org.apache.jasper.compiler.TagFileProcessor.loadTagFile(TagFileProcessor.java:584)
	at org.apache.jasper.compiler.TagFileProcessor.access$000(TagFileProcessor.java:50)
	at org.apache.jasper.compiler.TagFileProcessor$TagFileLoaderVisitor.visit(TagFileProcessor.java:666)
	at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1536)
	at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2376)
	at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2428)
	at org.apache.jasper.compiler.TagFileProcessor$TagFileLoaderVisitor.visit(TagFileProcessor.java:670)
	at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1536)
	at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2376)
	at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2428)
	at org.apache.jasper.compiler.TagFileProcessor$TagFileLoaderVisitor.visit(TagFileProcessor.java:670)
	at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1536)
	at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2376)
	at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2428)
	at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2434)
	at org.apache.jasper.compiler.Node$Root.accept(Node.java:464)
	at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2376)
	at org.apache.jasper.compiler.TagFileProcessor.loadTagFiles(TagFileProcessor.java:684)
	at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:229)
	at org.apache.jasper.compiler.Compiler.compile(Compiler.java:356)
	at org.apache.jasper.compiler.Compiler.compile(Compiler.java:336)
	at org.apache.jasper.compiler.Compiler.compile(Compiler.java:323)
	at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:580)
	at org.apache.jasper.servlet.JspServletWrapper.loadTagFile(JspServletWrapper.java:239)
	at org.apache.jasper.compiler.TagFileProcessor.loadTagFile(TagFileProcessor.java:584)
	at org.apache.jasper.compiler.TagFileProcessor.access$000(TagFileProcessor.java:50)
	at org.apache.jasper.compiler.TagFileProcessor$TagFileLoaderVisitor.visit(TagFileProcessor.java:666)
	at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1536)
	at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2376)
	at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2428)
	at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2434)
	at org.apache.jasper.compiler.Node$Root.accept(Node.java:464)
	at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2376)
	at org.apache.jasper.compiler.TagFileProcessor.loadTagFiles(TagFileProcessor.java:684)
	at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:229)
	at org.apache.jasper.compiler.Compiler.compile(Compiler.java:356)
	at org.apache.jasper.compiler.Compiler.compile(Compiler.java:336)
	at org.apache.jasper.compiler.Compiler.compile(Compiler.java:323)
	at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:580)
	at org.apache.jasper.servlet.JspServletWrapper.loadTagFile(JspServletWrapper.java:239)
	at org.apache.jasper.compiler.TagFileProcessor.loadTagFile(TagFileProcessor.java:584)
	at org.apache.jasper.compiler.TagFileProcessor.access$000(TagFileProcessor.java:50)
	at org.apache.jasper.compiler.TagFileProcessor$TagFileLoaderVisitor.visit(TagFileProcessor.java:666)
	at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1536)
	at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2376)
	at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2428)
	at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2434)
	at org.apache.jasper.compiler.Node$Root.accept(Node.java:464)
	at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2376)
	at org.apache.jasper.compiler.TagFileProcessor.loadTagFiles(TagFileProcessor.java:684)
	at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:229)
	at org.apache.jasper.compiler.Compiler.compile(Compiler.java:356)
	at org.apache.jasper.compiler.Compiler.compile(Compiler.java:336)
	at org.apache.jasper.compiler.Compiler.compile(Compiler.java:323)
	at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:580)
	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:356)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:396)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:340)
Comment 1 Mark Thomas 2015-05-05 13:14:12 UTC
This works for me with a simple test case (JSP and tag file in JAR, JSP depends on tag file). If you still see this with the latest stable 8.0.x release (8.0.22 is being released as I type this) please re-open and provide the simplest possible test case to demonstrate the issue.
Comment 2 Rafael Mattos 2015-05-05 16:37:42 UTC
Created attachment 32717 [details]
test case

The problem happens when you have a recursive call inside a tag, created this test case just to point the problem, will try with the new version
Comment 3 Rafael Mattos 2015-05-05 19:47:23 UTC
8.0.22 has the same problem, last version that works is 8.0.15, submit a test case to help analyze the problem
Comment 4 Mark Thomas 2015-05-06 14:47:16 UTC
Thanks for the test case. That made it pretty easy to track down the problem.

This has been fixed in trunk and 8.0.x and will be included in 8.0.23 onwards.