I am trying to write a Message consumer that is external to JBoss, it will connect to my JBoss server and consume messages created by the beans within the container.
I have followed the examples in the O'Reilly book Enterprise Java Beans but that is for Weblogic. When I try to run the consumer application I get a ClassCastException when I try and connect to the JBoss container with a jndi lookup.
My code is similar to this:
Contect jndiContect = new InitialContext();
TopicConnectionFactory factory = (TopicConnectionFactory)jndiContext.lookup("java:/ConnectionFactory");
with the second line causing the exception. I am probably missing something from my config file, but I cannot find something that explains what should go in there for JBoss. My base port is 9200 and JBoss is running on the same machine.
Any help will be much appreciated.
Thanks
Simon
YASNQ - Yet Another Stupid Newbie Question
java:/ConnectionFactory is the in VM
version for use inside the server.
Use one of the other ones, such as
"ConnectionFactory" from an external client.
Regards,
Adrian