FreeKB - IBM MQ Resolve "JMSWMQ0018 Failed to connect to queue manager"
IBM MQ - Resolve "JMSWMQ0018 Failed to connect to queue manager"

Let's say the following error occurs when attempting to connect to the queue manager named MANAGER01 on the IBM MQ system with hostname on port 5201.

JMSWMQ0018: Failed to connect to queue manager 'MANAGER01' with connection mode 'Client' and host name ''.


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


Use the dspmq command to ensure the queue manager is running.

~]# dspmq


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)
LOGUTIL(92)                             MEDIALOG(S0774841.LOG)
MEDIASZ(34341)                          RECLOG(S0776986.LOG)
RECSZ(26)                               REUSESZ(0)
STANDBY(PERMIT)                         STARTDA(2021-02-25)


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
   PID(9679)                               STARTDA(2021-02-25)
   STARTTI(21.30.58)                       DESCR( )
   TRPTYPE(TCP)                            CONTROL(QMGR)
   IPADDR(*)                               PORT(5201)


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').


Add a Comment

We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.

Please enter 26ced in the box below so that we can be sure you are a human.


Web design by yours truely - me, myself, and I   |   |