MDB not consuming messages from Websphere MQ in 7.1.1.Final
holgum Jun 5, 2012 9:23 AMHaving problems trying to get MDB to consume messages from WebSphere MQ.
I followed the instructions here: https://access.redhat.com/knowledge/ja/node/88823 (which are also reflected in various other posts I found on this forum)
No errors on startup, and I can see a connection in MQ Explorer when when JBoss starts up, but messages just sit there on the queue and are not received by MDB.
I turned on the tracing for wmq.jmsra.rar in standalone.conf:
JAVA_OPTS="$JAVA_OPTS -DtraceEnabled=true -DtraceDestination=System.out -DtraceLevel=11 -DlogWriterEnabled=true"
and I get a lot of FFDC files with the following:
------------------------------------------------------
| Exception :- ExceptionDepth is 2
| Exception :-
| | Cause:1 :- com.ibm.msg.client.jms.DetailedIllegalStateException: JMSCC0033: A synchronous method call is not permitted when a session is being used asynchronously: 'deliver'.
| | The JMS specification does not permit the use of a session for synchronous methods when asynchronous message delivery is running.
| | Create a separate session if you wish to use both synchronous methods and asynchronous delivery simultaneously.
| | Message:1 :- JMSCC0033: A synchronous method call is not permitted when a session is being used asynchronously: 'deliver'.
| | StackTrace:1 :- com.ibm.msg.client.jms.DetailedIllegalStateException: JMSCC0033: A synchronous method call is not permitted when a session is being used asynchronously: 'deliver'.
| | The JMS specification does not permit the use of a session for synchronous methods when asynchronous message delivery is running.
| | Create a separate session if you wish to use both synchronous methods and asynchronous delivery simultaneously.
| | at sun.reflect.GeneratedConstructorAccessor6.newInstance(Unknown Source)
| | at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
| | at java.lang.reflect.Constructor.newInstance(Unknown Source)
| | at com.ibm.msg.client.commonservices.j2se.NLSServices.createException(NLSServices.java:314)
| | at com.ibm.msg.client.commonservices.nls.NLSServices.createException(NLSServices.java:228)
| | at com.ibm.msg.client.jms.internal.JmsErrorUtils.createException(JmsErrorUtils.java:104)
| | at com.ibm.msg.client.jms.internal.JmsSessionImpl.deliver(JmsSessionImpl.java:2786)
| | at com.ibm.mq.jms.MQSession.deliver(MQSession.java:1068)
| | at com.ibm.msg.client.jms.internal.JmsConnectionConsumerImpl$JmsMessageReferenceHandlerImpl.endDeliverInternal(JmsConnectionConsumerImpl.java:399)
| | at com.ibm.msg.client.jms.internal.JmsConnectionConsumerImpl$JmsMessageReferenceHandlerImpl.handleMessageReference(JmsConnectionConsumerImpl.java:456)
| | at com.ibm.msg.client.jms.internal.JmsConnectionImpl$JmsProviderMessageRefHandler.handleMessageReference(JmsConnectionImpl.java:1484)
| | at com.ibm.msg.client.wmq.internal.WMQConnectionBrowser$WMQConnectionBrowserShadow.consumer(WMQConnectionBrowser.java:856)
| | at com.ibm.mq.jmqi.remote.impl.RemoteProxyQueue.driveConsumer(RemoteProxyQueue.java:4217)
| | at com.ibm.mq.jmqi.remote.impl.RemoteProxyQueue.deliverMsgs(RemoteProxyQueue.java:4811)
| | at com.ibm.mq.jmqi.remote.impl.RemoteDispatchThread.deliverMsgsReconnectable(RemoteDispatchThread.java:549)
Has anyone else seen this?
MDB annotated as follows:
----------------------------------------
@MessageDriven(name = "MyMDB", activationConfig = {
@ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
@ActivationConfigProperty(propertyName = "destination", propertyValue = "QUEUE1"),
@ActivationConfigProperty(propertyName = "useJNDI", propertyValue = "false"),
@ActivationConfigProperty(propertyName = "queueManager", propertyValue = "QMA"),
@ActivationConfigProperty(propertyName = "transportType", propertyValue = "CLIENT"),
@ActivationConfigProperty(propertyName = "hostName", propertyValue = "localhost"),
@ActivationConfigProperty(propertyName = "port", propertyValue = "1414"),
@ActivationConfigProperty(propertyName = "channel", propertyValue = "JBOSS.SVRCONN"),
@ActivationConfigProperty(propertyName = "messagingType", propertyValue = "javax.jms.MessageListener")
})
@ResourceAdapter(value = "wmq.jmsra.rar")
@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
public class MyMDB implements MessageListener {
public MyMDB() {
// TODO Auto-generated constructor stub
}
public void onMessage(Message message) {
// TODO Auto-generated method stub
System.out.println("*** GOT MQ MESSAGE!");
TextMessage textMessage = (TextMessage) message;
try {
System.out.println(textMessage.getText());
} catch (JMSException e) {
e.printStackTrace();
}
}
standalone-full.xml has:
<subsystem xmlns="urn:jboss:domain:resource-adapters:1.0">
<resource-adapters>
<resource-adapter>
<archive>
wmq.jmsra.rar
</archive>
</resource-adapter>
</resource-adapters>
</subsystem>
and
<mdb>
<resource-adapter-ref resource-adapter-name="wmq.jmsra.rar"/>
<bean-instance-pool-ref pool-name="mdb-strict-max-pool"/>
</mdb>
I updated to latest Websphere Client: 7.1.0.1 (rar meta-inf has this version #)
The only anomalies I see on startup, which I am not sure are important:
==============================================
01:48:18,626 WARN [org.jboss.ejb3] (MSC service thread 1-3) JBAS014105: ActivationConfigProperty messagingType will be ignored since it is not allowed by resource adapter: wmq.jmsra
and also:
01:47:06,953 INFO [org.jboss.as.server.deployment] (MSC service thread 1-4) JBAS015876: Starting deployment of "wmq.jmsra.rar"
01:47:07,568 WARN [org.jboss.as.server.deployment] (MSC service thread 1-4) Class Path entry ldap.jar in "/content/wmq.jmsra.rar/com.ibm.mqjms.jar" does not point to a valid jar for a Class-Path reference.
01:47:07,568 WARN [org.jboss.as.server.deployment] (MSC service thread 1-4) Class Path entry jndi.jar in "/content/wmq.jmsra.rar/com.ibm.mqjms.jar" does not point to a valid jar for a Class-Path reference.
01:47:07,569 WARN [org.jboss.as.server.deployment] (MSC service thread 1-4) Class Path entry fscontext.jar in "/content/wmq.jmsra.rar/com.ibm.mqjms.jar" does not point to a valid jar for a Class-Path reference.
01:47:07,569 WARN [org.jboss.as.server.deployment] (MSC service thread 1-4) Class Path entry providerutil.jar in "/content/wmq.jmsra.rar/com.ibm.mqjms.jar" does not point to a valid jar for a Class-Path reference.
01:47:07,570 WARN [org.jboss.as.server.deployment] (MSC service thread 1-4) Class Path entry jms.jar in "/content/wmq.jmsra.rar/com.ibm.msg.client.jms.jar" does not point to a valid jar for a Class-Path reference.
I see several posts saying that it is working, but all seem to be from AS 7.1.0. not 7.1.1.Final (?)