File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes BEA/Weblogic and the fly likes ClassCastException JMSConnectionFactory Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "ClassCastException JMSConnectionFactory" Watch "ClassCastException JMSConnectionFactory" New topic

ClassCastException JMSConnectionFactory

Naveen Verma

Joined: Jun 05, 2002
Posts: 9
I am using jboss-4.0.5.GA and have defined JMS connection factories and queues. Everything is fine in the AppServer and all MDB's are deployed and work fine. I get a classcast exception while trying to do a lookup for the
QueueConnectionFactory. The class being returned by JBoss is org.jboss.resource.adapter.jms.JmsConnectionFactoryImpl as opposed to javax.jms.QueueConnectionFactory which is what i expect to get.

The connectionfactory is defined as below in the jms-ds.xml file in jboss..

The client program does a simple lookup for the connection factory and the
relevent section is as shown below..

queueConnectionFactory = (javax.jms.QueueConnectionFactory Source code of javax.jms.QueueConnectionFactory)jndiContext.lookup(

The above line fails with a ClassCastException because JBoss is not returning the connection factory typecasted to javax.jms.QueueConnectionFactory

Any advice, please?
I agree. Here's the link:
subject: ClassCastException JMSConnectionFactory
It's not a secret anymore!