2
votes

Executing the below code which attempts to connect WebSphere MQ QueueManager using client mode I got MQJMS2005 exception

MQQueueConnectionFactory cf = new MQQueueConnectionFactory();
cf.setPort(port);
cf.setHostName(host);
cf.setChannel(channel);
cf.setTransportType(JMSC.MQJMS_TP_CLIENT_MQ_TCPIP);
cf.setQueueManager(queuemanager);

conn = (MQQueueConnection)cf.createQueueConnection();

I use com.ibm.mq.jar , com.ibm.mqjms.jar, dhbcore.jar, jmscommon.jar and j2ee.jar.

I assume this might be something related to permission, because the same code can work fine on another machine when connecting to another host/port/channel/queue manager/queue

The stack trace is as follows:

javax.jms.JMSException: MQJMS2005: failed to create MQQueueManager for 'host:queuemanager'
at com.ibm.mq.jms.services.ConfigEnvironment.newException(ConfigEnvironment.java:644)
at com.ibm.mq.jms.MQConnection.createQM(MQConnection.java:2591)
at com.ibm.mq.jms.MQConnection.createQMNonXA(MQConnection.java:1936)
at com.ibm.mq.jms.MQQueueConnection.<init>(MQQueueConnection.java:161)
at com.ibm.mq.jms.MQQueueConnectionFactory.createQueueConnection(MQQueueConnectionFactory.java:206)
at com.ibm.mq.jms.MQQueueConnectionFactory.createQueueConnection(MQQueueConnectionFactory.java:126)
at MQTest.init(MQTest.java:51)

How can I troubleshoot this so that I can make run the code sucessfully?

3

3 Answers

3
votes

This is the exception comming we have issue with .binding file or in the DEV-WEST file , where we are configuring the MQ client information like SSP-FLOW.VERICHECK_HOST_NAME = 113.130.234.174 i.e check all these area , these are the flaw area due to which exception if comming .

0
votes

later I found out that it's due to permission issues. when connecting to MQ using client mode, the MQ can be configured with permission settings such as allowed client ip; In my previous case, the machine is not added to the allowed list;

while the other app running fine actually is using bind mode rather than client mode. so it's bind to one allowed user id.

0
votes

I came across the same problem. It's to do with no of channels or some setting on MQ Queuemanager xml or Websphere MQ Installation. This might help.