I am new to using MQ, but need to do the seemingly simplest task. I need a
Java client program to make a MQ connection and send a
string over that connection to a server.
Here is what I know.
- I have installed the MQ Client v5.3 on Windows XP.
- I have received a .tab file from the server group.
- I have configured the environment properly, enabling me to use amqsputc to successfully send a message to the server.
Now comes the rub. I have been trying to use the sample MSender.java to write that same message from a Java program, but can't get to first base. If I try the following:
qMgr = new MQQueueManager( qManagerName );
I get the following error:
java.lang.UnsatisfiedLinkError: no mqjbnd05 in java.library.path
The file mqjbnd05 doesn't come with the client distribution, it comes with the full distribution. So I tried the following:
java.util.Hashtable props = new java.util.Hashtable();
props.put(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_CLIENT);
qMgr = new MQQueueManager( qManagerName, props );
Now it doesn't look for the server libraries, but I get a different error:
MQJE001: An MQException occurred: Completion Code 2, Reason 2059
MQJE011: Socket connection attempt refused
MQJE001: An MQException occurred: Completion Code 2, Reason 2059
MQJE011: Socket connection attempt refused
WMQ exception occurred : Completion code 2 Reason code 2059
I've been pulling my hair out for weeks, and can't get this to work. If anyone could help me get the simplest "Hello MQ World" to work, I would be grateful.