Uploaded image for project: 'ActiveMQ'
  1. ActiveMQ
  2. AMQ-3537

ClassLoadingAwareObjectInputStream cannot handle deserializing proxies with mixed JDK & non-JDK interfaces

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.5.0
    • Fix Version/s: 5.6.0
    • Component/s: JMS client
    • Labels:
      None
    • Environment:

      JDK 1.6.0, RHEL 6.0, ActiveMQ 5.5.0, Tomcat 7, Hibernate 3.6.7.Final, Spring 3.0.3.RELEASE

      Description

      When the ActiveMQ client attempts to unpack an ObjectMessage that contains a proxy with a mix of JDK and non-JDK interfaces the ClassLoadingAwareObjectInputStream chooses ONLY the ClassLoader from the first interface in the array of interfaces represented by the proxy. This means that if a proxy's first interface is a JDK class (java.util.List, java.sql.Blob) the core ClassLoader is used. In the event that a non-JDK interface is present in the list of proxied interfaces the same core ClassLoader is used. The Proxy.getProxyClass subsequently throws an IllegalArgumentException because the non-JDK interface class cannot be loaded by the core ClassLoader.

      This problem is extant during deserialization of an ObjectMessage payload that contains a proxy that implements [java.sql.Blob, org.hibernate.engine.jdbc.WrappedBlob, java.io.Serializable] (a blob proxy created by hibernate SerializableBlobProxy). The impact of this bug is that users of Hibernate cannot use ActiveMQ as a messaging framework if they need to package ValueObjects that have mapped lobs.

        Attachments

        1. AMQ3537Test.groovy
          2 kB
          Jason Yankus
        2. AMQ3537Test.java
          3 kB
          Jason Yankus

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              jason.yankus Jason Yankus
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: