activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dejan Bosanac <de...@nighttale.net>
Subject Re: ClassCastException
Date Fri, 02 Jul 2010 10:56:28 GMT
Hi,

make sure you get javax.jms.Message in your onMessage() method, by
either importing it or using using it explicitly in the param
definition.

Cheers
--
Dejan Bosanac - http://twitter.com/dejanb

Open Source Integration - http://fusesource.com/
ActiveMQ in Action - http://www.manning.com/snyder/
Blog - http://www.nighttale.net



On Fri, Jul 2, 2010 at 12:25 PM, lernit2007
<erpolat.erkan@googlemail.com> wrote:
>
> Hello,
>
> I have a following interface:
>
> public interface Test extends Message {
>
> public void testMessage();
>
> public void getString();
>
> }
>
> If I get a Message I want to cast the Message in Test:
>
> public void onMessage(Message message) {
>   Test test = (Test) message;
>
> }
>
> But I get the following Exception:
>
> java.lang.ClassCastException:
> org.apache.activemq.command.ActiveMQTextMessage cannot be cast to Test.
>
> Can you help me further please? I don't know, what the problem is.
> --
> View this message in context: http://old.nabble.com/ClassCastException-tp29054743p29054743.html
> Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.
>
>

Mime
View raw message