mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
LaunchedURLClassLoader preemptively defines the package for any classes that it attempts to load so that the manifest from a nested jar is correctly associated with the package. This can lead to a race where the package is defined on two threads in parallel, resulting in an IllegalArgumentException being thrown. This problem was manifesting itself as a NoClassDefFoundError. If the initialization of a class failed due to the above-described IllegalArgumentException, subsequent attempts to use that class would then fail with a NoClassDefFoundError. This commit updates LaunchedURLClassLoader to catch the IllegalArgumentException and then double-check that the package has already been defined. This approach, including thrown an AssertionError when the second check fails, is modelled on the approach taken by URLClassLoader. Closes gh-5464 |
||
---|---|---|
.. | ||
spring-boot-antlib | ||
spring-boot-configuration-metadata | ||
spring-boot-configuration-processor | ||
spring-boot-gradle-plugin | ||
spring-boot-loader | ||
spring-boot-loader-tools | ||
spring-boot-maven-plugin | ||
pom.xml |