【问题标题】:Connection refused while connection : MQJE001: Completion Code '2', Reason '2538'连接时连接被拒绝:MQJE001:完成代码“2”,原因“2538”
【发布时间】:2020-05-26 11:02:20
【问题描述】:

我正在尝试访问队列。

def mqProps = new Hashtable<String, Object>()
mqProps.put(MQConstants.CHANNEL_PROPERTY, 'CHANNEL')
mqProps.put(MQConstants.PORT_PROPERTY, PORT)
mqProps.put(MQConstants.HOST_NAME_PROPERTY, 'HOST')
mqProps.put(MQConstants.USER_ID_PROPERTY, 'myuser') // is it the correct property for the user? 
mqProps.put(MQConstants.PASSWORD_PROPERTY, 'mypassword') // is it the correct property for the password?

def qMgr = new MQQueueManager('QM', mqProps)

但是我遇到了以下错误

javax.script.ScriptException: com.ibm.mq.MQException: MQJE001: Completion Code '2', Reason '2538'
...
Caused by: com.ibm.mq.MQException: MQJE001: Completion Code '2', Reason '2538'.
...
Caused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2538;AMQ9204: Connection to host 'HOST(PORT)' rejected.
...
Caused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2538;AMQ9204: Connection to host 'HOST/address:PORT' rejected.
...
Caused by: java.net.ConnectException: Connection timed out: connect
...

错误发生在线路上:

def qMgr = new MQQueueManager('QM', mqProps)

你能解释一下这个问题的原因吗?非常感谢。

【问题讨论】:

  • 您能否远程登录到相同的主机和端口,如果可以,您需要查看队列管理器的AMQERR01.LOG 以了解更多详细信息。

标签: jms ibm-mq


【解决方案1】:

原因代码 2538 是 MQRC_HOST_NOT_AVAILABLE

您可以使用 IBM MQ 附带的mqrc 命令行工具快速发现这一点。类型:

mqrc 2538

你会被告知:

    2538  0x000009ea  MQRC_HOST_NOT_AVAILABLE

您也可以在 IBM MQ 知识中心中查找。

阅读 Knowledge Center 中的说明将向您展示该问题的一些常见可能性。

  • 尚未在远程系统上启动侦听器。
  • 客户端通道定义中的连接名称不正确。
  • 网络当前不可用。
  • 防火墙阻止端口或特定协议的流量

也许最常见的错误是在队列管理器上运行的侦听器使用的端口号与您在客户端应用程序连接详细信息中输入的端口号不同。

您没有在您的问题中向我们展示有关在队列管理器上运行的侦听器的任何详细信息,因此我们必须将其留给您自己检查。

【讨论】:

    猜你喜欢
    • 2014-03-07
    • 2016-05-19
    • 1970-01-01
    • 1970-01-01
    • 2011-06-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多