Forum Stats

  • 3,874,108 Users
  • 2,266,682 Discussions
  • 7,911,728 Comments

Discussions

java.lang.ClassCastException

Hi,

Please help me out...

My Code :

Properties properties1 = new Properties();
properties1.put(Context.INITIAL_CONTEXT_FACTORY,
"com.tibco.tibjms.naming.TibjmsInitialContextFactory");
properties1.put(Context.PROVIDER_URL, "tibjmsnaming://localhost:7222");
InitialContext iniCtx = new InitialContext(properties1);

Object tmp = iniCtx.lookup("QueueConnectionFactory");
QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;
QueueConnection conn = qcf.createQueueConnection();
this.connection = conn;
Queue que = (Queue) iniCtx.lookup("interface_num_1_req");
session = conn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);


Getting the below error:

com.tibco.tibjms.naming.TibjmsFederatedQueueConnectionFactory cannot be cast to javax.jms.QueueConnectionFactory
This discussion has been closed.