Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-3265

Problem with empty classname in classloader

    XMLWordPrintable

Details

    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) == '[' )

      { 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.

      Attachments

        Activity

          People

            starksm64 Scott Stark (Inactive)
            adrian.brock Adrian Brock (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: