File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB and other Java EE Technologies and the fly likes JBoss Messaging - Sending Object Messages Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "JBoss Messaging - Sending Object Messages" Watch "JBoss Messaging - Sending Object Messages" New topic

JBoss Messaging - Sending Object Messages

Raja Gullapalli

Joined: Jun 10, 2009
Posts: 15

I'm trying to send Object Messages to a JMS Queue. The Object is serializable, and able to pass it to the queue without any error.
On the Consumer side, when I try to type cast it back to the desired object. It fails with the below error:

2009-06-10 10:49:17,515 ERROR [org.jboss.jms.client.container.ClientConsumer] (Thread-30) RuntimeException was thrown from onMessage, 20392446480891904 will be redelivered
java.lang.ClassCastException: org.jboss.jms.message.ObjectMessageProxy
at com.tsswireless.application.dispatch.jms.DispatchQueueListener.onMessage(
at org.jboss.jms.client.container.ClientConsumer.callOnMessage(
at org.jboss.jms.client.container.ClientConsumer$
at org.jboss.messaging.util.OrderedExecutorFactory$
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(
at java.util.concurrent.ThreadPoolExecutor$

I've tried googling around, and everyone suggest to set the Payload type to "SYS.AQ$_JMS_OBJECT_MESSAGE", but could not find where to set it.

I agree. Here's the link:
subject: JBoss Messaging - Sending Object Messages
It's not a secret anymore!