wood burning stoves 2.0*
The moose likes Websphere and the fly likes java.lang.NoClassDefFoundError: com/ibm/mqbind/MQSESSION Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Websphere
Bookmark "java.lang.NoClassDefFoundError: com/ibm/mqbind/MQSESSION" Watch "java.lang.NoClassDefFoundError: com/ibm/mqbind/MQSESSION" New topic

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

Tatyana Lomberg

Joined: Apr 16, 2009
Posts: 1

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!

It is sorta covered in the JavaRanch Style Guide.
subject: java.lang.NoClassDefFoundError: com/ibm/mqbind/MQSESSION
Similar Threads
MQ ssl problem in Linux
MQWebsphere(MQJE001: An MQException occurred: Completion Code 2, Reason 2059)
Help With Simple Java MQ Connection?
Connecting to MQ Series from a java app
Do i need to disconnect queue manager, send queue after i send each message?