WebSphere MQ Configuration issues

srini picture srini · Sep 13, 2012 · Viewed 10.6k times · Source

getting below error after i configure MQ connection factory.

java.lang.ClassCastException: com.ibm.ejs.jms.JMSQueueConnectionFactoryHandle incompatible with com.ibm.mq.jms.MQQueueConnectionFactory

my code snippet where the exception is pointing to :

String queueConnectionJndi = props.getProperty(queueConnection + MQ_CONN); queueConnectionFactory = MQQueueConnectionFactory)initialContext.lookup(queueConnectionJndi);

I am not able to find out the root cause of this.

can any body please help me on this, Thanks in advance.

Answer

Tim Lamballais picture Tim Lamballais · Sep 21, 2012

There is no way to be sure without more context, but it looks like this method call:

initialContext.lookup(queueConnectionJndi);

is returning an object of type com.ibm.ejs.jms.JMSQueueConnectionFactoryHandle which cannot be cast to com.ibm.mq.jms.MQQueueConnectionFactory.

Can you provide more context?