New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
java.lang.IllegalStateException: zip file closed in Spring Boot 3.0.2 #34028
Comments
This is a duplicate of #33633. |
But can someone tell me what the workaround is? #33633 isn't clear at all what I need to do to make this work. I tried downgrading to the latest Spring Boot 2.x which currently is v2.7.8, but that breaks my unit tests because Spring Boot 2.x uses an old version of the JUnit API, which produces I can work around that, but then Spring Boot 2.x relies on the obsolete SLF4J What workaround is there to get this to work in Spring Boot 3? |
The workaround for Spring Boot 3 is to set the system property |
But adding something to the command line defeats much of the purpose of a Spring Boot executable JAR. You're telling me the entire Spring Boot 3 ecosystem is hobbled in this way? So if I deploy my JARs in the cloud with some orchestrator, I'll have to muck with the settings to add this special system property just to get them to run?? |
For those coming late to this ticket, I was incorrect in my understanding. In fact "the entire Spring Boot 3 ecosystem" is not "hobbled". Rather, although Spring could and should improve the code related to this issue (#32106), this particular problem currently only surfaces when JSP is being used, in particular using Tomcat Jasper. Thus it rarely occurs, and with old technology, so it has not surprisingly been given low priority. See #33633 for more details and for the status of updated documentation. Update: This appears to have been mitigated in Tomcat, so this issue should no longer appear. |
@garretwilson thanks! |
I see a similar bug described in other tickets such as #23821, but they all claim this was fixed back in 2020 in the Spring Boot 2.x line.
I have a very simple JSP/Thymeleaf Spring Boot app I haven't touched in a couple of years. I just now opened the project and updated the dependencies to the latest version, including Spring Boot 3.0.2. It uses my own root POM and imports Spring Boot:
The web modules makes an executable JAR:
When I run it using
java -jar web\target\myapp-web-1.1.0-SNAPSHOT.jar
with Java 17 I get "java.lang.IllegalStateException: zip file closed", apparently when Tomcat tries to access the JAR manifest:The text was updated successfully, but these errors were encountered: