]
Scott M Stark resolved JBAS-3265.
---------------------------------
Fix Version/s: JBossAS-5.0.0.Beta2
Resolution: Done
Reject null or empty class names with a CNFE
Problem with empty classname in classloader
-------------------------------------------
Key: JBAS-3265
URL:
http://jira.jboss.com/jira/browse/JBAS-3265
Project: JBoss Application Server
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: JMX
Affects Versions: JBossAS-4.0.4.GA
Reporter: Adrian Brock
Assigned To: Scott M Stark
Fix For: JBossAS-5.0.0.Beta2, JBossAS-4.2.0.CR1
The RepositoryClassLoader doesn't handle empty classnames correctly.
It eventually breaks when it tries to do the array name handling here:
// If this is an array class, use Class.forName to resolve it
if( name.charAt(0) == '[' )
{
result = Class.forName(name, true, this);
removeFromClassBlackList(name);
return result;
}
17:04:42,858 ERROR [STDERR] java.lang.StringIndexOutOfBoundsException: String index out
of range: 0
17:04:42,860 ERROR [STDERR] at java.lang.String.charAt(String.java:444)
17:04:42,861 ERROR [STDERR] at
org.jboss.mx.loading.RepositoryClassLoader.loadClassLocally(RepositoryClassLoader.java:169)
17:04:42,862 ERROR [STDERR] at
org.jboss.mx.loading.UnifiedLoaderRepository3.loadClassFromClassLoader(UnifiedLoaderRepository3.java:263)
17:04:42,862 ERROR [STDERR] at
org.jboss.mx.loading.LoadMgr3.beginLoadTask(LoadMgr3.java:270)
17:04:42,864 ERROR [STDERR] at
org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryClassLoader.java:475)
17:04:42,865 ERROR [STDERR] at
org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassLoader.java:377)
17:04:42,865 ERROR [STDERR] at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
The classloader should just reject a null or empty ("") classname in
loadClass()
with a meaningful error message.
I suspect the null is handled by the cache since the cache is a Concurrent HashMap
which won't accept null as a key.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: