• 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

java.lang.NoClassDefFoundError: com/ibm/mqbind/MQSESSION

Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I am trying to write a simple Java program which puts MQ Messages onto a queue.

I was given a sample program and an mq library, but I can't get it to compile.

public class MQTestPut {

private static String qManager = "DCWQ"; // define name of queue manager object to connect to.
private static MQQueueManager qMgr; // define a queue manager object

private static String hostName = "austin";

private static int port = 1415; // port to connect to. If not set, this defaults to 1414 for WebSphere MQ
// client connections.

private static String channel = "SYSTEM.ADMIN.SVRCONN"; // the CASE-SENSITIVE name of the SVRCONN channel on the queue manager

private static MQQueue system_default_local_queue = null;

private static String queueName = "TATYANA_TEMP";


System.out.println("Creating MqQMngr");

qMgr = new MQQueueManager(qManager);

System.out.println("Finished creating MqQMngr");

When I try to create an MQQueueManager, I get the following error:
Exception in thread "main" java.lang.NoClassDefFoundError: com/ibm/mqbind/MQSESSION
at com.ibm.mq.MQSESSIONServer.MQCONN(MQSESSIONServer.java:87)
at com.ibm.mq.MQQueueManager.connect(MQQueueManager.java:1271)
at com.ibm.mq.MQQueueManager.<init>(MQQueueManager.java:257)
at MQTestPut.test(MQTestPut.java:70)
at MQTestPut.main(MQTestPut.java:55)

the MQ library jar that I am using has the following packages: com.ibm.mq, com.ibm.mqbind, com.ibm.mqservices.

com.ibm.mq has classes such as MQSESSION, MQSESSIONClient and MQSESSIONServer.
com.ibm.mqbind does not have MQSESSION class.

I thought that perhaps I was given a bad jar file. However, upon looking thru the repository containing other applications, they also use a similar jar that does not have the com.ibm.mqbind.MQSESSION.class in them.

Can someone help me w/ some advice? I couldn't find anything on the Net on this topic.

Your help will be much appreciated!

    Bookmark Topic Watch Topic
  • New Topic