I was setting up my application to work with MQ but I was not getting the expected behavior. In the logs, I found this error:
07 Jun 2012 15:21:46,231 WARN DefaultMessageListenerContainer:834 - Setup of JMS message listener invoker failed for destination 'java:comp/env/jms/TESTRequest1Queue' - trying to recover. Cause: MQJMS2002: failed to get message from MQ queue; nested exception is com.ibm.mq.MQException: MQJE001: Completion Code 2, Reason 2016 07 Jun 2012 15:21:46,238 INFO DefaultMessageListenerContainer:875 - Successfully refreshed JMS Connection 07 Jun 2012 15:21:46,240 DEBUG JndiTemplate:150 - Looking up JNDI object with name [java:comp/env/jms/TESTRequest1Queue] 07 Jun 2012 15:21:46,240 DEBUG JndiDestinationResolver:111 - Located object with JNDI name [java:comp/env/jms/TESTRequest1Queue]
After double and triple checking my JMS connection factory properties (e.g. host, port, queue manager) and queue name were correct, I discovered the problem was the queue was GET inhibited.
I removed the GET inhibit on the queue and the error went away and my application began to work as expected.