diff --git a/spring-launcher/src/main/java/org/springframework/launcher/LaunchedURLClassLoader.java b/spring-launcher/src/main/java/org/springframework/launcher/LaunchedURLClassLoader.java index 7d088d497b..be2368f4bc 100644 --- a/spring-launcher/src/main/java/org/springframework/launcher/LaunchedURLClassLoader.java +++ b/spring-launcher/src/main/java/org/springframework/launcher/LaunchedURLClassLoader.java @@ -46,7 +46,12 @@ public class LaunchedURLClassLoader extends URLClassLoader { if (lastDot != -1) { String packageName = name.substring(0, lastDot); if (getPackage(packageName) == null) { - definePackageForFindClass(name, packageName); + try { + definePackageForFindClass(name, packageName); + } + catch (Exception ex) { + // Swallow and continue + } } } return super.findClass(name); @@ -72,6 +77,7 @@ public class LaunchedURLClassLoader extends URLClassLoader { if (jarFile.getManifest() != null && jarFile.getJarEntry(path) != null) { definePackage(packageName, jarFile.getManifest(), url); + return null; } } }