It seems I can never get my head round IBM products. MQSeries has proven to be no exception! Perhaps there's a conspiracy to keep PS in work? ;)
Anyway, gripes aside, I've been trying to get a Java client to talk to a remote MQSeries server.
I've downloaded MA88 and included a minimal set of JARs on my classpath (com.ibm.mq.jar and j2ee.jar) and have attempted to connect to the server using the following code (adapted from an IBM sample):
public MQSeriesTest(String server, int port, String queueManager, String channel, String queue)
{
MQEnvironment.hostname = server;
MQEnvironment.port = port;
MQEnvironment.channel = channel;
MQEnvironment.properties.put(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES);
this.queueManagerName = queueManager;
this.queueName = queue;
}
public void sendTestMessage() throws Exception
{
MQQueueManager queueManager = new MQQueueManager(queueManagerName);
MQQueue queue = queueManager.accessQueue(queueName, MQC.MQOO_OUTPUT);
MQMessage message = new MQMessage();
message.writeUTF("This is a test message from Java");
queue.put(message);
queueManager.disconnect();
}
However, all I get back is this:
Unable to load message catalog - mqji
com.ibm.mq.MQException: Message catalog not found
at com.ibm.mq.MQManagedConnectionJ11.<init>MQManagedConnectionJ11.java:171)
Other attempts to connect have led to a connection failure with reason code 2009.
The furthest I've managed to get on the IBM site is to resolve this to "bad configuration"
I am informed by the MQSeries administrator that my server, port, queue manager name, queue name and channel name are all correct.
Is there anyone out there who can spot what I'm doing wrong here?
Thanks.