You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Our application is split into two JARs (The first contains the spring boot launcher and our classes. The second file contains just 3rd party libraries) to be possible to share libraries between multiple applications to mitigate data transfer etc.:
I guess the problem is in synchronization between threads. The code contains synchronization blocks for elementary operation, but cannot detect if a different thread is trying to read data meanwhile.
Once I remove this part of the code (closing of nestedJar) I was not able to simulate this case again.
If I am right, those streams shouldn't be closed. One way could be to use ie. ByteArrayInputStream as a buffer and takes care just of the input streams reading the data.
The text was updated successfully, but these errors were encountered:
Having dug into #31853 a bit more I'm pretty sure this is a duplicate. @pj892031 If at all possible, once build 1110 if green, could you try the latest SNAPSHOT build and see if the issue is fixed?
Our application is split into two JARs (The first contains the spring boot launcher and our classes. The second file contains just 3rd party libraries) to be possible to share libraries between multiple applications to mitigate data transfer etc.:
jar lite.jar:
jar lite-lib.jar
We run this application with command like
java -cp lite.jar -Dloader.path=lite-lib.jar org.springframework.boot.loader.PropertiesLauncher
Our JDK:
Since version 2.6.9 we randomly got this exception:
It seems that the reason is the commit b42f056:
It collects references of nested JARs and then closes their streams if the main is closing, see:
spring-boot/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/JarFile.java
Line 99 in 24c2ed3
spring-boot/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/JarFile.java
Lines 335 to 347 in 24c2ed3
spring-boot/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/JarFile.java
Lines 362 to 379 in 24c2ed3
I guess the problem is in synchronization between threads. The code contains synchronization blocks for elementary operation, but cannot detect if a different thread is trying to read data meanwhile.
Once I remove this part of the code (closing of nestedJar) I was not able to simulate this case again.
spring-boot/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/JarFile.java
Lines 374 to 376 in 24c2ed3
If I am right, those streams shouldn't be closed. One way could be to use ie. ByteArrayInputStream as a buffer and takes care just of the input streams reading the data.
The text was updated successfully, but these errors were encountered: