users@glassfish.java.net

Async receiving ObjectMessage

From: <glassfish_at_javadesktop.org>
Date: Mon, 05 Oct 2009 05:55:59 PDT

I need to pass an object(Serializable) in my queue
to send it not a problem, but I can't get to receive the messages.
What I have done is implemented MessageListener class and created function:
public void onMessage(Message inMsg);

The problem is that I can't cast Message to ObjectMessage, I get an error:
[i]java.lang.ClassCastException: com.sun.messaging.jmq.jmsclient.MessageImpl cannot be cast to javax.jms.ObjectMessage[/i]

What I'm doing wrong? Any help or sample how to do it will be appreciated.

Thanks.
[Message sent by forum member 'alto' (arnonayal_at_hotmail.com)]

http://forums.java.net/jive/thread.jspa?messageID=366821