Properly set the parent classloader for the launched module
This commit is contained in:
@@ -18,7 +18,11 @@ package org.springframework.boot.loader;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.net.URL;
|
||||
import java.net.URLClassLoader;
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.springframework.boot.loader.archive.Archive;
|
||||
import org.springframework.boot.loader.util.AsciiBytes;
|
||||
@@ -34,6 +38,8 @@ import org.springframework.util.ReflectionUtils;
|
||||
*/
|
||||
public class ModuleJarLauncher extends ExecutableArchiveLauncher {
|
||||
|
||||
private final JavaAgentDetector javaAgentDetector = new InputArgumentsJavaAgentDetector();
|
||||
|
||||
private static final AsciiBytes LIB = new AsciiBytes("lib/");
|
||||
|
||||
public ModuleJarLauncher(Archive archive) {
|
||||
@@ -75,7 +81,7 @@ public class ModuleJarLauncher extends ExecutableArchiveLauncher {
|
||||
|
||||
@Override
|
||||
protected ClassLoader createClassLoader(URL[] urls) throws Exception {
|
||||
return new LaunchedURLClassLoader(urls, null);
|
||||
return new LaunchedURLClassLoader(urls, ClassLoader.getSystemClassLoader());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user