简体   繁体   English

使用 MQ JMS 连接到 IBM MQ 时出现 MQRC_NOT_AUTHORIZED 错误

[英]MQRC_NOT_AUTHORIZED error while connecting to IBM MQ using MQ JMS

I am not able to connect to IBM MQ using MQ classes for JMS way from my java client.我无法从我的 Java 客户端使用 JMS 的 MQ 类连接到 IBM MQ。 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.我的另一个应用程序尝试使用 Java 的 MQ 类连接到 IBM MQ,它工作正常。 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.编辑:我无法访问 AMQERR01.LOG/server 或 MQExplorer。

IBM MQ Queue manager version: 8.0.0.11 IBM MQ 队列管理器版本:8.0.0.11

IBM MQ classes for JMS JAR: com.ibm.mq.allclient-9.1.0.0.jar JMS JAR 的 IBM MQ 类: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();

Does it work if you leave out the USER_AUTHENTICATION ?如果您省略 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!");

Finally ,I got rid of the issue when I changed the channel name.最后,当我更改频道名称时,我摆脱了这个问题。 Previously my channel name was SYSTEM.DEF.SVRCONN .以前我的频道名称是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.我已更改为其他一些频道名称(由管理团队的某个人创建)。所以基本上,问题是该频道无权连接。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 从独立程序连接IBM MQ | 错误:('MQRC_NOT_AUTHORIZED') - Connecting IBM MQ from a Standalone program | Error: ('MQRC_NOT_AUTHORIZED') 我无法连接到 IBM MQ ERROR 2035 MQRC_NOT_AUTHORIZED 的 QM - I can't connect to QM of IBM MQ ERROR 2035 MQRC_NOT_AUTHORIZED IBM MQ 调用失败,compcode '2' ('MQCC_FAILED') 原因 '2035' ('MQRC_NOT_AUTHORIZED') - IBM MQ call failed with compcode '2' ('MQCC_FAILED') reason '2035' ('MQRC_NOT_AUTHORIZED') Websphere MQ v8 - MQRC_NOT_AUTHORIZED - 2035 - Websphere MQ v8 - MQRC_NOT_AUTHORIZED - 2035 在 JMS 中使用 CCDT 文件连接到 IBM MQ - Connecting to IBM MQ using CCDT file in JMS 连接到IBM MQ时出错 - Error connecting to IBM MQ 使用JMS + CCDT文件连接到IBM MQ时的负载平衡问题 - Load balancing issue while connecting to IBM MQ using JMS + CCDT file 使用JMS的Java客户端连接到IBM MQ Channel的TCP / IP抛出错误 - Java client using JMS for connecting to IBM MQ Channel of TCP/IP throwing error 将Java客户端(JMS)连接到IBM MQ时出现问题 - Problem Connecting a Java Client (JMS) to a IBM MQ 如何修复“JMSCMQ0001:WebSphere MQ 调用失败,compcode '2'('MQCC_FAILED')原因'2035'('MQRC_NOT_AUTHORIZED')' - How to fix 'JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2035' ('MQRC_NOT_AUTHORIZED')'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM