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

            Bug ID: 70251
           Summary: CloseableURLConnection closes shared Jar file
           Product: Tomcat 11
           Version: 11.0.25
          Hardware: All
                OS: All
            Status: NEW
          Severity: regression
          Priority: P2
         Component: Util
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: -------

Environment: Tomcat version: 11.0.25+ (confirmed on 11.0.25 and 11.0.26)
​Framework: Spring Boot (packaged as an executable WAR with nested JARs
containing JSPs)

​Description:

When compiling JSPs located inside nested JAR files within a Spring Boot
executable WAR, compilation fails with the following exception:

​java.lang.IllegalStateException: Zip file closed

Bisecting pointed to the following commit:

https://github.com/apache/tomcat/commit/eeef2107fb3157591c26674212fa16dfd1946b72

​In CloseableURLConnection.close(), the try-with-resources statement actively
closes the underlying JarFile instance. In this deployment setup, the instance
is a Spring Boot NestedJarFile, which is shared across the application. Closing
it invalidates subsequent access, triggering the IllegalStateException on the
next resource read.

​I initially suspected an issue or incompatibility on the Spring Boot side and
opened a report here:

https://github.com/spring-projects/spring-boot/issues/51733

​According to the Spring Boot team, this appears to be a regression introduced
on Tomcat's side (see
https://github.com/spring-projects/spring-boot/issues/51733#issuecomment-5679108764).

​I have created a minimal reproducer project demonstrating the issue:

https://github.com/HENgames/sbjsp-reproducer

​Please refer to the README.md for steps to run. While this currently relies on
Spring Boot's launcher to supply the nested JAR structure, it consistently
reproduces the failure.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to