• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Getting issue while connecting MQ using JNDI created in WAS

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Getting below error while creating QueueSession:

java.lang.ClassCastException: com.ibm.ejs.jms.JMSSessionHandle incompatible with com.ibm.mq.jms.MQSession

I am using JMS and WAS 7.0 and trying to connect to MQ via JNDI(Queue and Queue manager) created in WAS admin console.


factory = (ConnectionFactory)ctx.lookup("jndi/NewMQManager");
System.out.println("Factory has been looked up-"+factory);

queue = (Queue) ctx.lookup("jms/XMLError");//
System.out.println("Queue Looked Up has been done-"+queue);

qCon= factory.createConnection();
System.out.println("Queue Factory Connection -"+qCon);

QueueSession queueSession =(QueueSession) qCon.createSession(false, Session.AUTO_ACKNOWLEDGE);
 
Rakesh Gupta
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Guys please respond, I am eagerly waiting for solution......

 
Bartender
Posts: 1359
39
IBM DB2 Netbeans IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You should post the full stacktrace. Anyway, error you got it's pretty explicit: I think you have imported (and used) the wrong classes. Generally speaking, an appserver runtime may expose more than a single class called "Session", you have to use the right one among various homonyms. Just think about  "Connection" classes: you have JDBC connections, MQ connections and so on.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic