0
votes

I am not able to connect to IBM MQ using MQ classes for JMS way from my java client. The error log says

com.ibm.msg.client.jms.DetailedJMSSecurityRuntimeException: JMSWMQ2013: The security authentication was not valid that was supplied for QueueManager 'TESTQUEUE' with connection mode 'Client' and host name 'xxxx'
Caused by: com.ibm.mq.MQException: JMSCMQ0001: IBM MQ call failed with compcode '2' ('MQCC_FAILED') reason '2035' ('MQRC_NOT_AUTHORIZED').

I do not have any credentials to provide as there is no authentication enabled. My other application which is trying to connect to IBM MQ using MQ classes for java is working fine. Am i missing something here?

I read all other posts related to this error and did some research but I haven't got proper solution anywhere and hence posting this question. Let me know if you need any more details

Edit: I do not have acccess to AMQERR01.LOG/server or MQExplorer.

IBM MQ Queue manager version: 8.0.0.11

IBM MQ classes for JMS JAR: com.ibm.mq.allclient-9.1.0.0.jar

Code sample :

jmsConFac.connectionsetIntProperty(WMQConstants.WMQ_CONNECTION_MODE, WMQConstants.WMQ_CM_CLIENT);
jmsConFac.setBooleanProperty(WMQConstants.USER_AUTHENTICATION_MQCSP, false);
JMSContext context = jmsConFac.createContext();
2
What error shows up in the TESTQUEUE queue manger's AMQERR01.LOG file when the JMS application receives this error? What version of IBM MQ is the queue manger? What version are your IBM MQ classes for JMS jar files from? How do you connect? Do you call createQueueConnection or createConnection. Do you pass any parameters? - JoshMc
Have added the requested details @JoshMc. Thanks - Stunner
If you don't have access to the AMQERR01.LOG, then please ask the MQ admin for this information. The 2035 on the client side is a generic error that can have multiple causes, the queue manager log will tell what the specific cause was. - JoshMc
If the code does not set a UserId (and optional Password) on the createQueueConnection method then the MQ Client library will use the UserId that the application is running under. - Roger
is it a possible scenario that the client jars (ibm mq classes for java) able to connect to a channel but (ibm mq classes for jms) not able to connect to same channel? is this possible and feasible scenario? - Stunner

2 Answers

0
votes

Does it work if you leave out the USER_AUTHENTICATION ? Something like this should work:

  // Create a connection factory
  JmsFactoryFactory ff = JmsFactoryFactory.getInstance(WMQConstants.WMQ_PROVIDER);
  JmsConnectionFactory cf = ff.createConnectionFactory();

  // Set the properties
  cf.setStringProperty(WMQConstants.WMQ_HOST_NAME, host);
  cf.setIntProperty(WMQConstants.WMQ_PORT, port);
  //cf.setStringProperty(WMQConstants.WMQ_CHANNEL, channel);
  cf.setIntProperty(WMQConstants.WMQ_CONNECTION_MODE, WMQConstants.WMQ_CM_CLIENT);
  cf.setStringProperty(WMQConstants.WMQ_QUEUE_MANAGER, queueManagerName);

  // Create JMS objects
  connection = cf.createConnection();
  System.out.println("Connected!");
0
votes

Finally ,I got rid of the issue when I changed the channel name. Previously my channel name was SYSTEM.DEF.SVRCONN. I have changed to some other channel name(created by someone from admin team.) So basically , the issue was the channel doesn't have access to connect.