[
https://jira.jboss.org/jira/browse/JBCL-142?page=com.atlassian.jira.plugi...
]
Adrian Brock commented on JBCL-142:
-----------------------------------
The issue only occurs when there is a security manager and there is some access control
logging
and only because a class in stdio needs to load java.lang.Math which is not already
loaded.
It doesn't occur with useLoadClassForParent=true because loadClass() doesn't do
any
access control logging.
Read the comments in the stacktrace from the bottom upwards to see what is happening.
java.lang.ClassCircularityError: java/lang/Math
<!-- Tries to load java/lang/Math again, resulting in CCE -->
at org.jboss.stdio.WriterOutputStream.write(WriterOutputStream.java:102)
at java.io.PrintStream.write(PrintStream.java:430)
at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:202)
at sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:263)
at sun.nio.cs.StreamEncoder.write(StreamEncoder.java:106)
at java.io.OutputStreamWriter.write(OutputStreamWriter.java:190)
at java.io.BufferedWriter.flushBuffer(BufferedWriter.java:111)
at java.io.PrintStream.write(PrintStream.java:476)
at java.io.PrintStream.print(PrintStream.java:619)
at java.io.PrintStream.println(PrintStream.java:756)
at org.jboss.stdio.StdioContext$DelegatingPrintStream.println(StdioContext.java:297)
<!-- Checking for the resource leads to do more logging -->
at sun.security.util.Debug.println(Debug.java:134)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:329)
at java.security.AccessController.checkPermission(AccessController.java:546)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
at sun.misc.URLClassPath.check(URLClassPath.java:410)
at sun.misc.URLClassPath$JarLoader.checkResource(URLClassPath.java:676)
at sun.misc.URLClassPath$JarLoader.getResource(URLClassPath.java:759)
at sun.misc.URLClassPath.getResource(URLClassPath.java:169)
at sun.misc.URLClassPath.getResource(URLClassPath.java:221)
at java.lang.ClassLoader.getBootstrapResource(ClassLoader.java:1151)
at java.lang.ClassLoader.getResource(ClassLoader.java:1000)
at java.lang.ClassLoader.getResource(ClassLoader.java:998)
at java.lang.ClassLoader.getResource(ClassLoader.java:998)
<!-- jboss-cl checks for java/lang/Math.class before locking the classloader -->
at
org.jboss.classloader.plugins.loader.ClassLoaderToLoaderAdapter$2.run(ClassLoaderToLoaderAdapter.java:112)
at
org.jboss.classloader.plugins.loader.ClassLoaderToLoaderAdapter$2.run(ClassLoaderToLoaderAdapter.java:1)
at java.security.AccessController.doPrivileged(Native Method)
at
org.jboss.classloader.plugins.loader.ClassLoaderToLoaderAdapter.getResource(ClassLoaderToLoaderAdapter.java:107)
at
org.jboss.classloader.spi.ClassLoaderDomain.findLoaderFromParent(ClassLoaderDomain.java:678)
at
org.jboss.classloader.spi.ClassLoaderDomain.findBeforeLoader(ClassLoaderDomain.java:624)
at
org.jboss.classloader.spi.base.BaseClassLoaderDomain.findLoader(BaseClassLoaderDomain.java:344)
at
org.jboss.classloader.spi.base.BaseClassLoaderDomain.loadClass(BaseClassLoaderDomain.java:264)
at
org.jboss.classloader.spi.base.BaseClassLoaderDomain.loadClass(BaseClassLoaderDomain.java:1129)
at
org.jboss.classloader.spi.base.BaseClassLoader.loadClassFromDomain(BaseClassLoader.java:882)
at org.jboss.classloader.spi.base.BaseClassLoader.doLoadClass(BaseClassLoader.java:523)
at org.jboss.classloader.spi.base.BaseClassLoader.loadClass(BaseClassLoader.java:468)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
<!-- stdio needs to load java.lang.Math -->
at org.jboss.stdio.WriterOutputStream.write(WriterOutputStream.java:102)
at java.io.PrintStream.write(PrintStream.java:430)
at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:202)
at sun.nio.cs.StreamEncoder.implFlushBuffer(StreamEncoder.java:272)
at sun.nio.cs.StreamEncoder.flushBuffer(StreamEncoder.java:85)
at java.io.OutputStreamWriter.flushBuffer(OutputStreamWriter.java:168)
at java.io.PrintStream.write(PrintStream.java:477)
at java.io.PrintStream.print(PrintStream.java:619)
at java.io.PrintStream.println(PrintStream.java:756)
at org.jboss.stdio.StdioContext$DelegatingPrintStream.println(StdioContext.java:297)
<!-- First access control logging after stdio is installed -->
at sun.security.util.Debug.println(Debug.java:134)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:329)
at java.security.AccessController.checkPermission(AccessController.java:546)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
at java.lang.Thread.setContextClassLoader(Thread.java:1351)
Investigate issue with useLoadClassForParent=false and security
manager logging
-------------------------------------------------------------------------------
Key: JBCL-142
URL:
https://jira.jboss.org/jira/browse/JBCL-142
Project: JBoss ClassLoader
Issue Type: Bug
Components: ClassLoader
Reporter: Adrian Brock
Assignee: Adrian Brock
Fix For: JBossCL.2.2.0.Alpha
With the change to useLoadForParent=false by default a problem has shown up
in jacc-security-manager tests in JBossAS.
Need to investigate why it is failing in that mode and fix it.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira