Uploaded image for project: 'HornetQ'
  1. HornetQ
  2. HORNETQ-747

ObjectInputStreamWithClassLoader uses ClassLoader.loadClass which fails for arrays

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Critical
    • Resolution: Done
    • Affects Version/s: 2.2.6.Final
    • Fix Version/s: 2.2.7.Final
    • Component/s: None
    • Labels:
      None

      Description

      ObjectInputStreamWithClassLoader.resolveClass has this:

         protected Class resolveClass(final ObjectStreamClass desc) throws IOException, ClassNotFoundException
         {
            String name = desc.getName();
            ClassLoader loader = Thread.currentThread().getContextClassLoader();
            try
            {
               Class clazz = loader.loadClass(name);
      
      

      This fails in JDK6+ for array classes http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6500212. It's recommended that Class.forName(className, false, classLoader) should be used instead.

      See the referenced forum thread which shows the failing usecase with ObjectMessage.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  ataylor Andy Taylor
                  Reporter:
                  jaikiran jaikiran pai
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  0 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: