Let's say the following error occurs when attempting to connect to the queue manager named MANAGER01 on the IBM MQ system with hostname manager01.example.com on port 5201.
JMSWMQ0018: Failed to connect to queue manager 'MANAGER01' with connection mode 'Client' and host name 'manager01.example.com(5201)'.
If you have access to the IBM MQ system, use the hostname command to ensure the hostname of the IBM MQ system matches the host name in the error messages.
~]# hostname manager01.example.com
Use the dspmq command to ensure the queue manager is running.
~]# dspmq QMNAME(MANAGER01) STATUS(Running)
Use the display qmstatus (queue manager status) command to determine how long the queue manager has been running. In this example, the queue manager has been running since 2/25/2021 at 21.30.58 (9:30 pm).
~]# echo "display qmstatus all" | runmqsc MANAGER01 QMNAME(MANAGER01) STATUS(Running) ARCHLOG( ) ARCHSZ(0) CHINIT(RUNNING) CMDSERV(RUNNING) CONNS(483) CURRLOG(S0776988.LOG) INSTDESC( ) INSTNAME(Installation1) INSTPATH(/opt/mqm) LDAPCONN(CONNECTED) LOGINUSE(85) LOGPATH(/var/logs/MANAGER001/) LOGUTIL(92) MEDIALOG(S0774841.LOG) MEDIASZ(34341) RECLOG(S0776986.LOG) RECSZ(26) REUSESZ(0) STANDBY(PERMIT) STARTDA(2021-02-25) STARTTI(21.30.58)
Use the display lsstatus command to ensure the queue manager is listening on the port in the error message, that the listener is running, and how long the listener has been running.
~]$ echo "display lsstatus(*) all" | runmqsc MANAGER01 LISTENER(MANAGER01.LISTENER) STATUS(RUNNING) PID(9679) STARTDA(2021-02-25) STARTTI(21.30.58) DESCR( ) TRPTYPE(TCP) CONTROL(QMGR) IPADDR(*) PORT(5201) BACKLOG(100)
Following this message, there should be another message that may help to determine why the connection has failed. In this scenario, refer to IBM MQ - Resolve JMSCMQ0001 MQRC_HOST_NOT_AVAILABLE.
JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2538' ('MQRC_HOST_NOT_AVAILABLE').