The following error occurs when attempting to submit a request to an IBM MQ server by a user that does not have access to the resource being requested.
Caused by: com.ibm.mq.MQException: JMSCMQ0001: IBM MQ call failed with compcode '2' ('MQCC_FAILED') reason '2035' ('MQRC_NOT_AUTHORIZED').
First, you will need to get the username and password of the user requesting the resource, the queue manager name, and the queue name. For example, if a Java application is requesting the resource, the Java application would contain the username, password, manager, and queue.
private static final String QMGR = "MANAGER01"; private static final String QUEUE = "QUEUE01"; private static final String USER = "JohnDoe"; private static final String PASSWORD = "itsasecret";
Ensure that the password is correct, which is outside of the scope of MQ.
Using the dspmqaut command, determine the permissions the user has. As an example, let's say JohnDoe has been granted to "connect" and "inq" permissions to queue manager MANAGER01.
Entity JohnDoe has the following authorizations for object MANAGER01: connect inq
And the "all" permission to QUEUE01.
<mq install root>/bin/dspmqaut -m MANAGER01 -n QUEUE01 -t queue -p JohnDoe Entity JohnDoe has the following authorizations for object QUEUE01: get browse put inq set dlt chg dsp passid passall setid setall clr