You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Jason Yankus (Created) (JIRA)" <ji...@apache.org> on 2011/10/11 20:55:12 UTC

[jira] [Created] (AMQ-3537) ClassLoadingAwareObjectInputStream cannot handle deserializing proxies with mixed JDK & non-JDK interfaces

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

                 Key: AMQ-3537
                 URL: https://issues.apache.org/jira/browse/AMQ-3537
             Project: ActiveMQ
          Issue Type: Bug
          Components: JMS client
    Affects Versions: 5.5.0
         Environment: RHEL 6.0, ActiveMQ 5.5.0, Tomcat 7, Hibernate 3.6.7.Final, Spring 3.0.3.RELEASE
            Reporter: Jason Yankus


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|https://github.com/hibernate/hibernate-core/blob/3.6.7.Final/hibernate-core/src/main/java/org/hibernate/engine/jdbc/SerializableBlobProxy.java]).   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.  

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (AMQ-3537) ClassLoadingAwareObjectInputStream cannot handle deserializing proxies with mixed JDK & non-JDK interfaces

Posted by "Jason Yankus (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AMQ-3537?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jason Yankus updated AMQ-3537:
------------------------------

    Attachment: AMQ3537Test.groovy

AMQ3537Test.groovy is a test case demonstrating the bug.  The list of interfaces at the top of the test can be manipulated to show that the ClassLoadingAwareObjectInputStream is only choosing the ClassLoader from the first interface in the array.
                
> ClassLoadingAwareObjectInputStream cannot handle deserializing proxies with mixed JDK & non-JDK interfaces
> ----------------------------------------------------------------------------------------------------------
>
>                 Key: AMQ-3537
>                 URL: https://issues.apache.org/jira/browse/AMQ-3537
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.5.0
>         Environment: RHEL 6.0, ActiveMQ 5.5.0, Tomcat 7, Hibernate 3.6.7.Final, Spring 3.0.3.RELEASE
>            Reporter: Jason Yankus
>         Attachments: AMQ3537Test.groovy
>
>
> 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|https://github.com/hibernate/hibernate-core/blob/3.6.7.Final/hibernate-core/src/main/java/org/hibernate/engine/jdbc/SerializableBlobProxy.java]).   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.  

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (AMQ-3537) ClassLoadingAwareObjectInputStream cannot handle deserializing proxies with mixed JDK & non-JDK interfaces

Posted by "Timothy Bish (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AMQ-3537?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13125330#comment-13125330 ] 

Timothy Bish commented on AMQ-3537:
-----------------------------------

Any chance you can port your unit test to Java, then it could be included in the test suite to validate any future changes.  Also in order to include patches or tests in the source you need to ensure that you tick the license grant to apache when you upload your files.
                
> ClassLoadingAwareObjectInputStream cannot handle deserializing proxies with mixed JDK & non-JDK interfaces
> ----------------------------------------------------------------------------------------------------------
>
>                 Key: AMQ-3537
>                 URL: https://issues.apache.org/jira/browse/AMQ-3537
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.5.0
>         Environment: JDK 1.6.0, RHEL 6.0, ActiveMQ 5.5.0, Tomcat 7, Hibernate 3.6.7.Final, Spring 3.0.3.RELEASE
>            Reporter: Jason Yankus
>         Attachments: AMQ3537Test.groovy
>
>
> 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|https://github.com/hibernate/hibernate-core/blob/3.6.7.Final/hibernate-core/src/main/java/org/hibernate/engine/jdbc/SerializableBlobProxy.java]).   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.  

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (AMQ-3537) ClassLoadingAwareObjectInputStream cannot handle deserializing proxies with mixed JDK & non-JDK interfaces

Posted by "Jason Yankus (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AMQ-3537?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jason Yankus updated AMQ-3537:
------------------------------

    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|https://github.com/hibernate/hibernate-core/blob/3.6.7.Final/hibernate-core/src/main/java/org/hibernate/engine/jdbc/SerializableBlobProxy.java]).   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.  

  was:
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|https://github.com/hibernate/hibernate-core/blob/3.6.7.Final/hibernate-core/src/main/java/org/hibernate/engine/jdbc/SerializableBlobProxy.java]).   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.  

    
> ClassLoadingAwareObjectInputStream cannot handle deserializing proxies with mixed JDK & non-JDK interfaces
> ----------------------------------------------------------------------------------------------------------
>
>                 Key: AMQ-3537
>                 URL: https://issues.apache.org/jira/browse/AMQ-3537
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.5.0
>         Environment: RHEL 6.0, ActiveMQ 5.5.0, Tomcat 7, Hibernate 3.6.7.Final, Spring 3.0.3.RELEASE
>            Reporter: Jason Yankus
>         Attachments: AMQ3537Test.groovy
>
>
> 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|https://github.com/hibernate/hibernate-core/blob/3.6.7.Final/hibernate-core/src/main/java/org/hibernate/engine/jdbc/SerializableBlobProxy.java]).   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.  

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (AMQ-3537) ClassLoadingAwareObjectInputStream cannot handle deserializing proxies with mixed JDK & non-JDK interfaces

Posted by "Timothy Bish (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AMQ-3537?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Timothy Bish resolved AMQ-3537.
-------------------------------

       Resolution: Fixed
    Fix Version/s: 5.6.0

Apply fix and add provided test case.
                
> ClassLoadingAwareObjectInputStream cannot handle deserializing proxies with mixed JDK & non-JDK interfaces
> ----------------------------------------------------------------------------------------------------------
>
>                 Key: AMQ-3537
>                 URL: https://issues.apache.org/jira/browse/AMQ-3537
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.5.0
>         Environment: JDK 1.6.0, RHEL 6.0, ActiveMQ 5.5.0, Tomcat 7, Hibernate 3.6.7.Final, Spring 3.0.3.RELEASE
>            Reporter: Jason Yankus
>             Fix For: 5.6.0
>
>         Attachments: AMQ3537Test.groovy, AMQ3537Test.java
>
>
> 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|https://github.com/hibernate/hibernate-core/blob/3.6.7.Final/hibernate-core/src/main/java/org/hibernate/engine/jdbc/SerializableBlobProxy.java]).   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.  

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (AMQ-3537) ClassLoadingAwareObjectInputStream cannot handle deserializing proxies with mixed JDK & non-JDK interfaces

Posted by "Jason Yankus (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AMQ-3537?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jason Yankus updated AMQ-3537:
------------------------------

    Environment: JDK 1.6.0, RHEL 6.0, ActiveMQ 5.5.0, Tomcat 7, Hibernate 3.6.7.Final, Spring 3.0.3.RELEASE  (was: RHEL 6.0, ActiveMQ 5.5.0, Tomcat 7, Hibernate 3.6.7.Final, Spring 3.0.3.RELEASE)
    
> ClassLoadingAwareObjectInputStream cannot handle deserializing proxies with mixed JDK & non-JDK interfaces
> ----------------------------------------------------------------------------------------------------------
>
>                 Key: AMQ-3537
>                 URL: https://issues.apache.org/jira/browse/AMQ-3537
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.5.0
>         Environment: JDK 1.6.0, RHEL 6.0, ActiveMQ 5.5.0, Tomcat 7, Hibernate 3.6.7.Final, Spring 3.0.3.RELEASE
>            Reporter: Jason Yankus
>         Attachments: AMQ3537Test.groovy
>
>
> 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|https://github.com/hibernate/hibernate-core/blob/3.6.7.Final/hibernate-core/src/main/java/org/hibernate/engine/jdbc/SerializableBlobProxy.java]).   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.  

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (AMQ-3537) ClassLoadingAwareObjectInputStream cannot handle deserializing proxies with mixed JDK & non-JDK interfaces

Posted by "Jason Yankus (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AMQ-3537?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jason Yankus updated AMQ-3537:
------------------------------

    Attachment: AMQ3537Test.java

Here is a simple java port of the groovy test case.
                
> ClassLoadingAwareObjectInputStream cannot handle deserializing proxies with mixed JDK & non-JDK interfaces
> ----------------------------------------------------------------------------------------------------------
>
>                 Key: AMQ-3537
>                 URL: https://issues.apache.org/jira/browse/AMQ-3537
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.5.0
>         Environment: JDK 1.6.0, RHEL 6.0, ActiveMQ 5.5.0, Tomcat 7, Hibernate 3.6.7.Final, Spring 3.0.3.RELEASE
>            Reporter: Jason Yankus
>         Attachments: AMQ3537Test.groovy, AMQ3537Test.java
>
>
> 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|https://github.com/hibernate/hibernate-core/blob/3.6.7.Final/hibernate-core/src/main/java/org/hibernate/engine/jdbc/SerializableBlobProxy.java]).   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.  

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira