Duel Classloading of javax.activation module from activation.jar
Issue
-
There is a strange claasloading problem with legacy webservices since upgrading from JBoss EAP 4.3 to JBoss EAP 6.x.
-
The javax.activation.DataHandler from the activation jar is getting loaded by two different classloaders. The two classloaders are:
- The bootstrap classloader. The classloader for the DataHandler class object is found to be 'null'.
-
The JBoss module classloader for the “javax.activation.api:main” module.
-
Why is the activation jar getting loaded by two different classloaders in EAP-6.x while this was loaded by a single classloader in the previous versions ?
- Is this is a known issue with EAP 6.x ?
- Can the module classloader for javax.activation be disabled ?
- What are the implications of disabling the module classloader for javax activation ?
-
Is there a way to tweak JBoss to load the classes from the same classloader ?
-
The code snippet that provides the conclusion about this is highligthed below :
Class xsiClass = context.getTypeMapping().getClassForQName(type);
System.err.println("new code called");
final ClassLoader classLoader = destClass.getClassLoader();
//additional classloader diagnostics
System.err.println("xsi class xsiClass = context.getTypeMapping().getClassForQName(type).getClassLoader()=" + context.getTypeMapping().getClassForQName(type).getClassLoader());
System.err.println("destination class classLoader=" + classLoader);
System.err.println(destClass.getProtectionDomain().getCodeSource().getLocation());
Environment
- JBoss Enterprise Application Platform (EAP)
- 6.x
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
