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)
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.
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
8.0.22 has the same problem, last version that works is 8.0.15, submit a test case to help analyze the problem
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.