Details
-
Bug
-
Resolution: Done
-
Major
-
JBossAS-4.0.4.GA
-
None
Description
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) == '[' )
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.