MQRC 2540: Channel name unknown
MQRC 2540 (MQRC_
Other names for this code
Also written as RC2540, reason code 2540, MQ 2540, MQ error 2540, MQRC_UNKNOWN_CHANNEL_NAME, 09EC, 0x09EC, unknown channel name, JMSWMQ0018 2540, MQ channel not found.
What it means
A client connection names a server-connection channel. The client sends that name to the queue manager when it connects, and the queue manager looks for a channel definition to match. If there isn't one, the connect fails with MQCC_
Channel names are case-sensitive, and MQSC folds unquoted names to uppercase. A channel defined with DEFINE CHANNEL(app. is really APP.SVRCONN, so a client asking for app.svrconn won't find it. The name comes from different places depending on how the client is set up. It may be in the MQSERVER environment variable, in the format CHANNEL/
The network connection worked, so a listener is running at the host and port. That listener may belong to a different queue manager from the one where the channel was defined, which is a common source of confusion on hosts that run several queue managers.
Common causes
- A typo or wrong case in the channel name in MQSERVER, the CCDT, the connection factory or the application's code.
- The server-connection channel was never defined on this queue manager, or was deleted.
- The client reaches a listener belonging to a different queue manager on the same host, where that channel doesn't exist.
- The CCDT has a CLNTCONN entry whose name doesn't match any SVRCONN on the server. The two names must be the same.
How to find the problem
- Check the server for the channel with
DISPLAY CHANNEL(APP.in runmqsc. On z/OS, use the same command with the command prefix.SVRCONN) CHLTYPE - Read the queue manager error log. It records the name the client asked for, so you can compare it character by character.
- Check where the client gets its channel name. Look at
echo $MQSERVER, the CCDT location (MQCHLLIB and MQCHLTAB, or the ChannelDefinitionDirectory in mqclient.ini), or the connection factory. - Confirm which queue manager owns the listener on that port, with
DISPLAY LSSTATUS(*) PORTon each queue manager.
How to fix it
- Correct the channel name in the client configuration, matching case exactly.
- Define the server-connection channel on the right queue manager, for example
DEFINE CHANNEL(APP., and add CHLAUTH rules for it.SVRCONN) CHLTYPE(SVRCONN) TRPTYPE(TCP) - Make CLNTCONN names in the CCDT identical to the SVRCONN names on the server.
- Point the client at the port of the queue manager that owns the channel.
What it looks like
JMSWMQ0018: Failed to connect to queue manager 'QM1' with connection mode 'Client' and host name 'mqhost01(1414)'.
JMSCMQ0001: IBM MQ call failed with compcode '2' ('MQCC_FAILED') reason '2540' ('MQRC_UNKNOWN_CHANNEL_NAME').IBM documentation
IBM documentation: MQRC 2540. Use the documentation for your installed release.
Related codes
Questions
Are MQ channel names case-sensitive?
Yes. MQSC changes unquoted names to uppercase, so a channel defined without quotes is uppercase even if you typed it in lowercase.
What is the difference between 2540 and 2538?
2538 means the client couldn't reach the host and port at all. 2540 means it reached a queue manager, which didn't know the channel name.
Does the client-connection channel name have to match the server-connection name?
Yes. The client sends its channel name, and the queue manager looks for a server-connection channel with exactly that name.