当前位置: 首页 > 知识库问答 >
问题:

JMSWMQ2020:连接到队列管理器失败

蒋原
2023-03-14

我正在尝试使用ccdt.tab文件连接到队列管理器。以下是我所尝试的:

String CHANNEL_TABLE_PATH = "/usr/dev/ccdt.tab";
URL chanTableUrl = new URL("file://"+ CHANNEL_TABLE_PATH);
connectionFactory.setCCDTURL(chanTableUrl);
connectionFactory.setQueueManager("*");
MQQueueConnection connection = (MQQueueConnection) connectionFactory.createQueueConnection();
connection.start();

以下是ccdt.tab中的内容

DIS CHL(*) QMNAME CONNAME
Display Channel details.
   CHANNEL(C.TEST.1)                     CHLTYPE(CLNTCONN)
   CONNAME(host1.test.com(1511), host2.test.com(1512))   QMNAME(QQ)
Display Channel details.
   CHANNEL(C.TEST.2)            CHLTYPE(CLNTCONN)
   CONNAME( )                              QMNAME( )
connectionFactory.setConnectionNameList("host1.test.com(1511), host2.test.com(1512)");
connectionFactory.setClientReconnectOptions(67108864);
connectionFactory.setClientReconnectTimeout(1800);
connectionFactory.setQueueManager("QQ");
connectionFactory.setChannel("C.TEST.1");
MQQueueConnection connection = (MQQueueConnection) connectionFactory_.createQueueConnection();
connection.start();

有谁知道哪里出了问题,怎么修复?

PS:我确实看到了那些帖子:在JMS中使用CCDT文件连接到IBM MQ

下面是链接的异常和异常在IsetQueueManager(“*”)时打印出来的:

01-19-2018 00:36:02,581 ERROR [main] (MQConnection.java:60) - Caught JMSException
01-19-2018 00:36:02,581 ERROR [main] (MQConnection.java:61) - linked exceptions com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2059' ('MQRC_Q_MGR_NOT_AVAILABLE').
01-19-2018 00:36:02,581 ERROR [main] (MQConnection.java:66) - Exception Msg: JMSWMQ2020: Failed to connect to queue manager '*' with connection mode 'Client' and supplied CCDT URL 'file:/usr/dev/ccdt.tab', see linked exception for more information.
01-19-2018 00:36:02,581 ERROR [main] (MQConnection.java:70) - JMS Error code: JMSWMQ2020
01-19-2018 00:36:02,581 ERROR [main] (MQConnection.java:73) - JMS Explanation: null
01-19-2018 00:36:02,582 ERROR [main] (MQConnection.java:74) - JMS Explanation: Check the queue manager is started and if running in client mode, check there is a listener running. Please see the linked exception for more information.
01-19-2018 00:36:02,582 ERROR [main] (MQConnection.java:66) - Exception Msg: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2059' ('MQRC_Q_MGR_NOT_AVAILABLE').
01-19-2018 00:36:02,582 ERROR [main] (MQConnection.java:78) - WMQ Completion code: 2
01-19-2018 00:36:02,582 ERROR [main] (MQConnection.java:79) - WMQ Reason code: 2059
01-19-2018 00:36:02,583 ERROR [main] (MQConnection.java:66) - Exception Msg: CC=2;RC=2059;AMQ9204: Connection to host '' rejected. [1=com.ibm.mq.jmqi.JmqiException[CC=2;RC=2059;AMQ9213: A communications error for  occurred. [1=java.net.ConnectException[Connection refused],3=localhost]],3=,5=RemoteTCPConnection.connnectUsingLocalAddress]
01-19-2018 00:36:02,584 ERROR [main] (MQConnection.java:82) - WMQ Log Message: 1/19/18 12:36:02 AM - User(Rle) Program(java)
AMQ9204: Connection to host '' rejected.

EXPLANATION:
Connection to host '' over '?' was rejected.
ACTION:
The remote system may not be configured to allow connections from this host.
Check the '?' listener program has been started on host ''.
If the conversation uses LU 6.2, it is possible that either the User ID or
Password supplied to the remote host is incorrect.
If the conversation uses TCP/IP, it is possible that the remote host does not
recognize the local host as a valid host.
The return code from the '?''RemoteTCPConnection.connnectUsingLocalAddress'
call was 'com.ibm.mq.jmqi.JmqiException[CC=2;RC=2059;AMQ9213: A communications
error for occurred. [1=java.net.ConnectException[Connection
refused],3=localhost]]' X('?').
Record the error values and tell the systems administrator.
---- RemoteFAP.java : 2010 -----------------------------------------------------

01-19-2018 00:36:02,585 ERROR [main] (MQConnection.java:83) - WMQ Explanation: Connection to host '' over '?' was rejected.
01-19-2018 00:36:02,585 ERROR [main] (MQConnection.java:84) - WMQ Msg Summary: AMQ9204: Connection to host '' rejected.
01-19-2018 00:36:02,585 ERROR [main] (MQConnection.java:85) - WMQ Msg User Response: The remote system may not be configured to allow connections from this host. Check the '?' listener program has been started on host ''.
 If the conversation uses LU 6.2, it is possible that either the User ID or Password supplied to the remote host is incorrect.
 If the conversation uses TCP/IP, it is possible that the remote host does not recognize the local host as a valid host.
 The return code from the '?''RemoteTCPConnection.connnectUsingLocalAddress' call was 'com.ibm.mq.jmqi.JmqiException[CC=2;RC=2059;AMQ9213: A communications error for  occurred. [1=java.net.ConnectException[Connection refused],3=localhost]]' X('?').
 Record the error values and tell the systems administrator.
01-19-2018 00:36:02,585 ERROR [main] (MQConnection.java:87) - WMQ Msg Severity: 30
01-19-2018 00:36:02,586 ERROR [main] (MQConnection.java:66) - Exception Msg: CC=2;RC=2059;AMQ9213: A communications error for  occurred. [1=java.net.ConnectException[Connection refused],3=localhost]
01-19-2018 00:36:02,586 ERROR [main] (MQConnection.java:82) - WMQ Log Message: 1/19/18 12:36:02 AM - User(Rle) Program(java)
AMQ9213: A communications error for occurred.

EXPLANATION:
An unexpected error occurred in communications.
ACTION:
The return code from the call was 'java.net.ConnectException[Connection
refused]' (X'?'). Record these values and tell the systems administrator.
---- RemoteTCPConnection.java : 663 --------------------------------------------

01-19-2018 00:36:02,587 ERROR [main] (MQConnection.java:83) - WMQ Explanation: An unexpected error occurred in communications.
01-19-2018 00:36:02,587 ERROR [main] (MQConnection.java:84) - WMQ Msg Summary: AMQ9213: A communications error for  occurred.
01-19-2018 00:36:02,587 ERROR [main] (MQConnection.java:85) - WMQ Msg User Response: The return code from the  call was 'java.net.ConnectException[Connection refused]' (X'?'). Record these values and tell the systems administrator.
01-19-2018 00:36:02,587 ERROR [main] (MQConnection.java:87) - WMQ Msg Severity: 30
01-19-2018 00:36:02,587 ERROR [main] (MQConnection.java:66) - Exception Msg: Connection refused

以下是当我setQueueManager(“QQ”)时链接的异常和异常打印:

01-19-2018 16:58:18,825 ERROR [main] (MQConnection.java:60) - Caught JMSException
01-19-2018 16:58:18,825 ERROR [main] (MQConnection.java:61) - linked exceptions com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2058' ('MQRC_Q_MGR_NAME_ERROR').
01-19-2018 16:58:18,825 ERROR [main] (MQConnection.java:66) - Exception Msg: JMSWMQ2020: Failed to connect to queue manager 'QQ' with connection mode 'Client' and supplied CCDT URL'file:/usr/dev/ccdt.tab', see linked exception for more information.
01-19-2018 16:58:18,825 ERROR [main] (MQConnection.java:70) - JMS Error code: JMSWMQ2020
01-19-2018 16:58:18,825 ERROR [main] (MQConnection.java:73) - JMS Explanation: null
01-19-2018 16:58:18,825 ERROR [main] (MQConnection.java:74) - JMS Explanation: Check the queue manager is started and if running in client mode, check there is a listener running. Please see the linked exception for more information.
01-19-2018 16:58:18,826 ERROR [main] (MQConnection.java:66) - Exception Msg: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2058' ('MQRC_Q_MGR_NAME_ERROR').
01-19-2018 16:58:18,826 ERROR [main] (MQConnection.java:78) - WMQ Completion code: 2
01-19-2018 16:58:18,826 ERROR [main] (MQConnection.java:79) - WMQ Reason code: 2058
01-19-2018 16:58:18,830 ERROR [main] (MQConnection.java:66) - Exception Msg: CC=2;RC=2059;AMQ9204: Connection to host 'host1.test.com(1511)' rejected. [3=host1.test.com(1511)]
01-19-2018 16:58:18,831 ERROR [main] (MQConnection.java:82) - WMQ Log Message: 1/19/18 4:58:18 PM - User(Rle) Program(java)
AMQ9204: Connection to host 'host1.test.com(1511)' rejected.

EXPLANATION:
Connection to host 'host1.test.com(1511)' over '?' was rejected.
ACTION:
The remote system may not be configured to allow connections from this host.
Check the '?' listener program has been started on host
'host1.test.com(1511)'.
If the conversation uses LU 6.2, it is possible that either the User ID or
Password supplied to the remote host is incorrect.
If the conversation uses TCP/IP, it is possible that the remote host does not
recognize the local host as a valid host.
The return code from the '?''?' call was '?' X('?').
Record the error values and tell the systems administrator.
---- RemoteFAP.java : 1980 -----------------------------------------------------

01-19-2018 16:58:18,831 ERROR [main] (MQConnection.java:83) - WMQ Explanation: Connection to host 'host1.test.com(1511)' over '?' was rejected.
01-19-2018 16:58:18,831 ERROR [main] (MQConnection.java:84) - WMQ Msg Summary: AMQ9204: Connection to host 'host1.test.com(1511)' rejected.
01-19-2018 16:58:18,831 ERROR [main] (MQConnection.java:85) - WMQ Msg User Response: The remote system may not be configured to allow connections from this host. Check the '?' listener program has been started on host 'host1.test.com(1511)'.
 If the conversation uses LU 6.2, it is possible that either the User ID or Password supplied to the remote host is incorrect.
 If the conversation uses TCP/IP, it is possible that the remote host does not recognize the local host as a valid host.
 The return code from the '?''?' call was '?' X('?').
 Record the error values and tell the systems administrator.
01-19-2018 16:58:18,831 ERROR [main] (MQConnection.java:87) - WMQ Msg Severity: 30

共有1个答案

郗福
2023-03-14

当您指定SetQueueManager(“*”)时,错误是:

AMQ9204: Connection to host '' rejected.

这是因为IBM MQ可以解析CCDT中的两个通道中的任何一个。通道c.test.2没有conname,因此当MQ选择该通道时,会导致上述错误。如果您多次尝试连接,如果它选择通道c.test.1,可能会成功一些次。

当您指定SetQueueManager(“QQ”)时,错误是:

JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2058' ('MQRC_Q_MGR_NAME_ERROR').

如果需要,还可以使用setQueueManager(“*”),但是需要使用MQ v8或更高版本runmqsc来编辑CCDT并删除第二个通道delete CHL(c.test.2)。这样,*只能解析到剩下的单个通道QQ,还允许您连接到监听conname中指定的主机和端口的任何队列管理器

 类似资料: