14 Replies Latest reply: May 15, 2012 5:40 PM by Clebert Suconic RSS

JBoss AS 7.1.1.Final cannot getObject when sending java.lang.reflect.Proxy object

Sebastian Raue Newbie

I try to port our application from jboss 4.2.2GA to jboss 7.1.1. After 4 weeks of work most parts of the application are running now on jboss 7.1.1.

But we are facing now a problem with hornetq:

 

We have made a data transfer object generator library some years ago which generate dto instances on the fly only knowing the respective interface

of the dto to generate. The library produces java.lang.reflect.Proxy objects which we - stateless session beans - send as object messages to message queues.

The respective MessageListener of our application gets the message - onMessage is called with the message object - but when we call ( ( ObjectMessage )inMessage ).getObject()

we get a long stack trace:

 

.....

 

Caused by: javax.jms.JMSException: com.pvs.pmm.sratest.events.data.MyObjectMessage from [Module "org.hornetq:main" from local module loader @2adb1d4 (roots: /home/sra/newworkspace/workspace/jboss/modules)]

    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)

    at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)

    at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)

    at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:423)

    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)

    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)

    at java.lang.Class.forName0(Native Method) [rt.jar:1.6.0_29]

    at java.lang.Class.forName(Class.java:247) [rt.jar:1.6.0_29]

    at java.io.ObjectInputStream.resolveProxyClass(ObjectInputStream.java:675) [rt.jar:1.6.0_29]

    at java.io.ObjectInputStream.readProxyDesc(ObjectInputStream.java:1530) [rt.jar:1.6.0_29]

    at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1492) [rt.jar:1.6.0_29]

    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1731) [rt.jar:1.6.0_29]

    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328) [rt.jar:1.6.0_29]

    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:350) [rt.jar:1.6.0_29]

    at org.hornetq.jms.client.HornetQObjectMessage.getObject(HornetQObjectMessage.java:158)

    at com.pvs.pmm.sratest.events.receivers.TestReceiver.onMessage(TestReceiver.java:28) [pmm-ejb.jar:]

   ... 54 more

 

.......

 

com.pvs.pmm.sratest.events.data.MyObjectMessage is the interface from which the proxy object has been generated.

 

When we send an instance of a class which implements  com.pvs.pmm.sratest.events.data.MyObjectMessage all

is fine. We used our dto generator (sending jms message objects) with jboss 4.0.5, 4.2.2GA and I have ported our

application successful to jboss 6 some years ago.

 

PLEASE HELP!