Created
February 12, 2014 14:40
-
-
Save gregturn/8956690 to your computer and use it in GitHub Desktop.
adding extra dump of environment and classloader info
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void main(String[] args) { | |
System.getProperties().list(System.out); | |
for (String key : System.getenv().keySet()) { | |
System.out.println(key + " => " + System.getenv(key)); | |
} | |
dumpClassPaths(ApplicationConfiguration.class.getClassLoader()); | |
SpringApplication.run(ApplicationConfiguration.class, args); | |
} | |
private static void dumpClassPaths(ClassLoader classLoader) { | |
System.out.println("Classloader " + classLoader + ":"); | |
if (classLoader instanceof URLClassLoader) { | |
URLClassLoader urlClassLoader = (URLClassLoader) classLoader; | |
for (URL url : urlClassLoader.getURLs()) { | |
System.out.println(url); | |
} | |
} else { | |
System.out.println("Not a URLClassLoader."); | |
} | |
if (classLoader.getParent() != null) { | |
dumpClassPaths(classLoader.getParent()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment