0
votes

AppConfig.xml settings:

<bean id="connectionFactory" class="com.ibm.mq.jms.MQQueueConnectionFactory">
<property name="hostName" value="abchost.com />
<property name="port" value="1414" />
<property name="queueManager" value="ABC_DEV" />
<property name="transportType" value="1" />

<jms:listener-container acknowledge="transacted">
    <jms:listener destination="abc.queue.abc"
            ref="someComplexServiceImpl"
            method="doSomething" />
</jms:listener-container>

<bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate">
    <property name="connectionFactory" ref="connectionFactory" />
    <property name="defaultDestinationName" value="abc.queue.abc"/>
</bean>

I get the following errors:

Caused by: com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2035' ('MQRC_NOT_AUTHORIZED').
[9/26/16 13:13:35:758 CST] 000000aa SystemErr     R     at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:204)
[9/26/16 13:13:35:758 CST] 000000aa SystemErr     R     ... 98 more



Cause: JMSWMQ2013: The security authentication was not valid that was supplied for QueueManager 'ABC_DEV' with connection mode 'Client' and host name 'abchost.com(1414)'.; nested exception is com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2035' ('MQRC_NOT_AUTHORIZED')

What I like to find out is, is there problem in the codes or in some setting in Websphere MQ we need to configure? I wanna make sure this is not a fault in the program before I raise the problem to our Websphere MQ administrator (who by the way is just new to Websphere MQ)

We are using:

  • Websphere MQ version 9

  • Spring JMS Version 4.2.4.RELEASE

I used MQ Client to connect to MQ, and I was able to connect (via command line):

C:\Users\me>set MQSERVER=CH.ABC_DEV/TCP/abchost.com(1414)

C:\Users\me>set MQSAMP_USER_ID=someuser

C:\Users\me>c:\IBM\MQ\Tools\c\Samples\Bin\amqsbcgc.exe abc.queue.abc ABC_DEV

Enter password: p@ssword



--connected!

but why cant the same user work when connecting through WAS?

2

2 Answers

1
votes

My application was also not able to connect to MQ although I provided the correct credentials. Enabling the authentication compatibility mode solved the issue.

See also: IBM MQ Connection authentication

If you are using mq-jms-spring-boot-starter you can add this in application.properties: ibm.mq.userAuthenticationMQCP=false

Internally this will apply this to the connection factory: cf.setBooleanProperty(WMQConstants.USER_AUTHENTICATION_MQCSP, false);

0
votes

As the message at the bottom clearly says, the connection attempt was rejected with reason code 2035, not authorized. Your MQ administrator must check the MQ error log on the queue manager side for the specific reason. There are multiple ways of setting up the connection authentication and authorization, you need to consult MQ documentation. Additionally, chances are after setting up the connection authorization the application will fail with 2035 when opening the queue(s), so keep reading.