I am very new to MQ Series and would like to test my MQ Server ( Remote)connection through Java Client. Here is my sample code.
// MQSeries classes for Java sample application
import com.ibm.mq.*; // Include the MQSeries classes for Java package
import java.util.Hashtable; // Required for properties
public class MQSample
{
private String hostname = "hub-tm1"; // Remote host
private String qManager = "MQBKRT1.QM1"; // queue name
private String channel = "CHANNEL.JAVA"; // Channel name
private MQQueueManager qMgr;
public static void main(String args[]) {
new MQSample();
}
MQMessage hello_world = new MQMessage();
hello_world.writeUTF("Hello World!");
MQPutMessageOptions pmo = new MQPutMessageOptions(); // accept the // defaults,
// same as MQPMO_DEFAULT
system_default_local_queue.put(hello_world,pmo);
MQMessage retrievedMessage = new MQMessage();
retrievedMessage.messageId = hello_world.messageId;
MQGetMessageOptions gmo = new MQGetMessageOptions(); // accept the defaults
// same as MQGMO_DEFAULT
system_default_local_queue.get(retrievedMessage, gmo);
I run the java class through bat file and getting the following errors.
E:MQmqmjavalibcode>call java -classpath "E:jdk1.3lib;E:Mqmqmjavalibc
om.ibm.mq.jar;." MQSample
Exception in thread "main" java.lang.NoClassDefFoundError: javax/transaction/xa/
XAException
at com.ibm.mq.MQSESSIONServer.getMQSESSION(MQSESSIONServer.java:67)
at com.ibm.mq.MQSESSION.getSession(MQSESSION.java:241)
at com.ibm.mq.MQManagedConnectionJ11.<init>(MQManagedConnectionJ11.java:
148)
at com.ibm.mq.MQBindingsManagedConnectionFactoryJ11._createManagedConnec
tion(MQBindingsManagedConnectionFactoryJ11.java:136)
at com.ibm.mq.MQBindingsManagedConnectionFactoryJ11.createManagedConnect
ion(MQBindingsManagedConnectionFactoryJ11.java:154)
at com.ibm.mq.StoredManagedConnection.<init>(StoredManagedConnection.jav
a:80)
at com.ibm.mq.MQSimpleConnectionManager.allocateConnection(MQSimpleConne
ctionManager.java:150)
at com.ibm.mq.MQQueueManager.obtainBaseMQQueueManager(MQQueueManager.jav
a:649)
at com.ibm.mq.MQQueueManager.construct(MQQueueManager.java:598)
at com.ibm.mq.MQQueueManager.<init>(MQQueueManager.java:375)
at MQSample.<init>(MQSample.java:37)
at MQSample.main(MQSample.java:23)
I appreciate your help/suggestions in regards to fix these errors
Regards
Sreeni
ERRORS :
[ This Message was edited by: sjagarla on 2002-04-24 12:05 ]
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum