I have Spring Boot application which listen IBM MQ Queue via @JmsListener
annotation as below from component class. The MQ properties (hostname, channel, port, etc) are set from yaml file.
@JmsListener(destination = "<QueueName>")
public void receiveMessage(BytesMessage msg) {
//snippet to read msg
}
The MQ dependencies are added in gradle build as below,
compile("com.ibm.mq:mq-jms-spring-boot-starter:0.0.2") {
exclude group: 'org.springframework.boot', module: 'spring-boot-starter-logging'
}
This works fine and listening the message as long as I run the application on local with Tomcat container. But if I package this as EAR and deploy to Wesbphere8.5 server, it throws below exception and listener is not reading the message from queue. I confirmed that all the run-time dependencies are packaged in EAR. Tried with different versions of MQ dependencies but no luck.
2018-07-10 15:21:16,531 ERROR DefaultMessageListenerContainer - Could not refresh JMS Connection for destination 'QueueName' - retrying using FixedBackOff{interval=5000, currentAttempts=34, maxAttempts=unlimited}. Cause: JMSFMQ6312: An exception occurred in the Java(tm) MQI.; nested exception is com.ibm.mq.jmqi.JmqiException: CC=2;RC=2195;AMQ9546: Error return code received. [1=java.lang.reflect.InvocationTargetException[null],3=NativeConstructorAccessorImpl.newInstance0]
Need help to fix this issue.