RE: Running Consumer sample:
"Tim Anderson" <[email protected]>
| Newsgroups | gmane.comp.java.openjms.devel |
|---|---|
| Message-ID | <[email protected]> |
Verify the type of the object, before casting:
Object object = context.lookup(topicName);
if (object instanceof Topic) {
....
} else if (object != null) {
System.err.println("Expected a topic, but got " +
object.getClass().getName());
} else {
System.err.println("Topic is null");
}
> -----Original Message-----
> From: openjms-developer-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> [mailto:openjms-developer-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org]On Behalf Of
> Thomas, Ivy
> Sent: Sunday, 27 July 2003 6:06 AM
> To: 'openjms-developer-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org'
> Subject: RE: [openjms-developer] Running Consumer sample:
>
>
> It is a topic and I tried casting it to both Topic and JmsTopic. Same
> problem. I tried running the Publisher sample and added the rebind and
> lookup but it failed.
> Thanks
> Ivy
>
> -----Original Message-----
> From: Thomas, Ivy [mailto:ithomas-T2hhe/[email protected]]
> Sent: Thursday, July 24, 2003 5:25 PM
> To: 'openjms-developer-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org'
> Subject: [openjms-developer] Running Consumer sample:
>
>
> Hello,
> Lookup of topic failed. Here is what I did.
> 1. startup -config ../config/tcp_jms.xml
> 2. runconsumer -topic topic1 -mode tcp -persistent
> The error is :
>
> examples client.console.SimpleConsumer -topic topic1 -mode tcp -persistent
> java.lang.ClassCastException
> at
> openjms.examples.client.console.SimpleConsumer.main(SimpleConsumer.ja
> va:251)
> Fatal error: java.lang.ClassCastException
> Exiting.....
> In the non persistent mode the Consumer (createtopic instead of lookup)
> works fine. It is failing at lookup of the topic name. I ran this example
> after my code started failing on lookup:(
> Appreciate your help.
> Thanks
> Ivy
>
>
>
> -------------------------------------------------------
> This SF.Net email sponsored by: Free pre-built ASP.NET sites including
> Data Reports, E-commerce, Portals, and Forums are available now.
> Download today and enter to win an XBOX or Visual Studio .NET.
> http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072
> 303_01/01
> _______________________________________________
> openjms-developer mailing list
> openjms-developer-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> https://lists.sourceforge.net/lists/listinfo/openjms-developer
>
>
> -------------------------------------------------------
> This SF.Net email sponsored by: Free pre-built ASP.NET sites including
> Data Reports, E-commerce, Portals, and Forums are available now.
> Download today and enter to win an XBOX or Visual Studio .NET.
> http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072
> 303_01/01
> _______________________________________________
> openjms-developer mailing list
> openjms-developer-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> https://lists.sourceforge.net/lists/listinfo/openjms-developer
>