Properly set the parent classloader for the launched module

This commit is contained in:
Marius Bogoevici
2015-08-12 17:31:49 -04:00
parent 05e12efb84
commit 9d75d5b4f1

View File

@@ -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());
}
}