Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
2.6.0
-
None
-
None
-
None
Description
We've seen a case where the isolated classloader fails if user code needs classes that are part of the system classes package but are not included in the "system".
One example we see is class org.w3c.dom.ElementTraversal:
java.lang.ClassNotFoundException: org.w3c.dom.ElementTraversal at java.net.URLClassLoader$1.run(URLClassLoader.java:366) at java.net.URLClassLoader$1.run(URLClassLoader.java:355) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:354) at java.lang.ClassLoader.loadClass(ClassLoader.java:425) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at java.lang.ClassLoader.loadClass(ClassLoader.java:358) at org.apache.hadoop.util.ApplicationClassLoader.loadClass(ApplicationClassLoader.java:202) at org.apache.hadoop.util.ApplicationClassLoader.loadClass(ApplicationClassLoader.java:170) ... 47 more
The org.w3c.dom package is included in the system class packages as it is provided by the JDK itself. However, this particular class (ElementTraversal) does not exist in the JDK. In this case, it was included in a Xerces library the user brought. However, since the package is declared as system classes, the application classloader will not look at the app classpath to locate this class.