You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2018/12/04 05:02:12 UTC

[Bug 62976] New: IllegalStateException: zip file closed

https://bz.apache.org/bugzilla/show_bug.cgi?id=62976

            Bug ID: 62976
           Summary: IllegalStateException: zip file closed
           Product: Tomcat 9
           Version: 9.0.13
          Hardware: PC
                OS: Mac OS X 10.1
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Jasper
          Assignee: dev@tomcat.apache.org
          Reporter: karl@xk72.com
  Target Milestone: -----

Created attachment 36290
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=36290&action=edit
Test case reproducing the issue

It appears that the bug https://bz.apache.org/bugzilla/show_bug.cgi?id=57887
has resurfaced in Tomcat 9.

The test case from that bug fails in Tomcat 9 with the error stack trace:

04-Dec-2018 17:57:06.353 SEVERE
[ContainerBackgroundProcessor[StandardEngine[Catalina]]]
org.apache.catalina.core.ApplicationContext.log Background compile failed
 java.lang.IllegalStateException: zip file closed
        at java.util.zip.ZipFile.ensureOpen(ZipFile.java:686)
        at java.util.zip.ZipFile.getEntry(ZipFile.java:315)
        at java.util.jar.JarFile.getEntry(JarFile.java:240)
        at
org.apache.tomcat.util.scan.JarFileUrlJar.getLastModified(JarFileUrlJar.java:94)
        at
org.apache.jasper.JspCompilationContext.getLastModified(JspCompilationContext.java:380)
        at
org.apache.jasper.JspCompilationContext.getLastModified(JspCompilationContext.java:368)
        at org.apache.jasper.compiler.Compiler.isOutDated(Compiler.java:480)
        at org.apache.jasper.compiler.Compiler.isOutDated(Compiler.java:434)
        at
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:596)
        at
org.apache.jasper.compiler.JspRuntimeContext.checkCompile(JspRuntimeContext.java:385)
        at
org.apache.jasper.servlet.JspServlet.periodicEvent(JspServlet.java:357)
        at
org.apache.catalina.core.StandardWrapper.backgroundProcess(StandardWrapper.java:623)
        at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1398)
        at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1402)
        at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1402)
        at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1402)
        at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1370)
        at java.lang.Thread.run(Thread.java:748)

This appears to be due to the .tag file in the JAR.

I have inserted debugging into JarFileUrlJar and I can see that getLastModified
is called successfully, close() is called, and then getLastModified is called
again and fails as the zip is closed.

I have attached the same test case hoping it's easier that getting it from that
bug. Make a WAR from the WebContent directory and deploy. Load the web app.
Wait a minute.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 62976] IllegalStateException: zip file closed

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=62976

--- Comment #1 from Mark Thomas <ma...@apache.org> ---
Note: To trigger this issue, development needs to be set to false and
checkInterval set to a positive integer - 60 is a reasonable number in this
instance.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 62976] IllegalStateException: zip file closed

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=62976

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #2 from Mark Thomas <ma...@apache.org> ---
Thanks for the report and for spotting the link to the previous issue. Very
helpful.

Fixed in:
- trunk for 9.0.14 onwards
- 8.5.x for 8.5.36 onwards

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 62976] IllegalStateException: zip file closed

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=62976

--- Comment #3 from Karl von Randow <ka...@xk72.com> ---
Mark, thank you very much. Love your work.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org