Created
April 2, 2014 18:21
-
-
Save valtoni/9940005 to your computer and use it in GitHub Desktop.
This chunck show classloaders and responsibles for your charge.
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
private static void printClassInfo(String className) { | |
Class<?> loadedClass; | |
try { | |
loadedClass = Class.forName(className); | |
System.out.println("Actual classloader: " + Thread.currentThread().getContextClassLoader()); | |
System.out.println("+ Class " + className + " loaded <<<<"); | |
if (loadedClass.getClassLoader() == null) { | |
System.out.println(" +- NO CLASSLOADER FOUND FOR CLASS " + loadedClass); | |
} | |
else { | |
System.out.println(" +- Classloader: " + loadedClass.getClassLoader()); | |
System.out.println(" +- Responsible class: " + loadedClass.getClassLoader().getClass().getName()); | |
System.out.println(" +- hash: " + loadedClass.getClassLoader().hashCode()); | |
} | |
} | |
catch (ClassNotFoundException e) { | |
System.err.println("ERROR: Class " + className + " not loaded"); | |
} | |
} | |
@Override | |
public boolean handleMessage(SOAPMessageContext messageContext) throws RuntimeException { | |
printClassInfo("javax.xml.bind.JAXBElement"); | |
printClassInfo("javax.xml.bind.NotIdentifiableEvent"); | |
printClassInfo("javax.mail.Address"); | |
printClassInfo("javax.xml.ws.Dispatch"); | |
printClassInfo("com.rsa.jsafe.CryptoJVersion"); | |
return true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment