spring-boot/spring-boot-tools
Andy Wilkinson 1d099035b1 Protect against a race condition when defining packages
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
2016-03-24 15:59:01 +00:00
..
spring-boot-antlib Next Development Version 2016-02-26 01:06:16 -08:00
spring-boot-configuration-metadata Merge branch '1.3.x' 2016-03-08 09:51:57 -08:00
spring-boot-configuration-processor Next Development Version 2016-02-26 01:06:16 -08:00
spring-boot-gradle-plugin Add a BuildInfo task for generating build.properties with Gradle 2016-03-24 08:59:55 +00:00
spring-boot-loader Protect against a race condition when defining packages 2016-03-24 15:59:01 +00:00
spring-boot-loader-tools Add a BuildInfo task for generating build.properties with Gradle 2016-03-24 08:59:55 +00:00
spring-boot-maven-plugin Add a BuildInfo task for generating build.properties with Gradle 2016-03-24 08:59:55 +00:00
pom.xml Next Development Version 2016-02-26 01:06:16 -08:00