Support Article

MDB Listener is failing to get created

SA-33129

Summary



Configured a MDB listener rule and did the corresponding EAR deployment.

Listener is showing up from the WAS console, but when a message comes to the Queue, Listener was not able to consume the message and message is going back to BACK OUT Queue.


Error Messages



2017-01-26 15:35:41,878 [stenerThreadPool : 0] [ ] [ ] ( etier.mdb.PRJMSListener) ERROR - PRPC Engine invocation failed, javax.ejb.TransactionRolledbackLocalException: ; nested exception is: java.lang.IllegalStateException: Internal state is compromised; cannot write out application hierarchy and/or rulesets
2017-01-26 15:36:28,857 [stenerThreadPool : 0] [ ] [ ] ( internal.access.Opener) ERROR - Caught exception during open
java.sql.SQLException: enlist: caught Exception
at com.ibm.ws.rsadapter.AdapterUtil.toSQLException(AdapterUtil.java:1699)
at com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.beginTransactionIfNecessary(WSJdbcConnection.java:815)
at com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.prepareStatement(WSJdbcConnection.java:2803)
at com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.prepareStatement(WSJdbcConnection.java:2756)
at com.pega.pegarules.data.internal.access.DatabaseConnectionImpl.prepareStatement(DatabaseConnectionImpl.java:566)
at com.pega.pegarules.data.internal.access.Opener.openData(Opener.java:683)
at com.pega.pegarules.data.internal.access.DatabaseImpl.open(DatabaseImpl.java:4247)
......
at com.pega.pegarules.internal.etier.mdb.PRJMSListenerBoot.onMessage(PRJMSListenerBoot.java:91)
at com.ibm.ejs.jms.listener.MDBWrapper$PriviledgedOnMessage.run(MDBWrapper.java:309)
at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:63)
at com.ibm.ejs.jms.listener.MDBWrapper.callOnMessage(MDBWrapper.java:266)
at com.ibm.ejs.jms.listener.MDBWrapper.onMessage(MDBWrapper.java:235)
at com.ibm.mq.jms.MQSession$FacadeMessageListener.onMessage(MQSession.java:133)
at com.ibm.msg.client.jms.internal.JmsSessionImpl.run(JmsSessionImpl.java:2911)
at com.ibm.mq.jms.MQSession.run(MQSession.java:958)
at com.ibm.ejs.jms.JMSSessionHandle.run(JMSSessionHandle.java:1056)
at com.ibm.ejs.jms.listener.ServerSession.connectionConsumerOnMessage(ServerSession.java:1090)
at com.ibm.ejs.jms.listener.ServerSession.onMessage(ServerSession.java:760)
at com.ibm.ejs.jms.listener.ServerSession.dispatch(ServerSession.java:726)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:95)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:56)
at java.lang.reflect.Method.invoke(Method.java:620)
at com.ibm.ejs.jms.listener.ServerSessionDispatcher.dispatch(ServerSessionDispatcher.java:47)
at com.ibm.ejs.container.MDBWrapper.onMessage(MDBWrapper.java:100)
at com.ibm.ejs.container.MDBWrapper.onMessage(MDBWrapper.java:132)
at com.ibm.ejs.jms.listener.ServerSession.run(ServerSession.java:581)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1881)
Caused by:
javax.resource.ResourceException: enlist: caught Exception
at com.ibm.ejs.j2c.LocalTransactionWrapper.enlist(LocalTransactionWrapper.java:735)
at com.ibm.ejs.j2c.ConnectionManager.lazyEnlist(ConnectionManager.java:2697)
at com.ibm.ws.rsadapter.spi.WSRdbManagedConnectionImpl.lazyEnlist(WSRdbManagedConnectionImpl.java:2653)
at com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.beginTransactionIfNecessary(WSJdbcConnection.java:745)
... 101 more
Caused by:
com.ibm.ws.Transaction.IllegalResourceIn2PCTransactionException: Illegal attempt to enlist multiple 1PC XAResources
at com.ibm.ws.tx.jta.RegisteredResources.enlistResource(RegisteredResources.java:916)
at com.ibm.ws.tx.jta.TransactionImpl.enlistResource(TransactionImpl.java:1850)
at com.ibm.tx.jta.embeddable.impl.EmbeddableTranManagerSet.enlistOnePhase(EmbeddableTranManagerSet.java:202)
at com.ibm.ejs.j2c.LocalTransactionWrapper.enlist(LocalTransactionWrapper.java:634)
.......


Steps to Reproduce



Send a message to the Queue that is associated with the listener.


Root Cause



An issue in the custom application code or rules. The transaction attribute for the failing MDB was 'Required' and the non-XAjdbc driver was used.

Resolution



Perform the following local-change:

In the ejb.xml:


<container-transaction>
<trans-attribute>Required</trans-attribute> to <trans-attribute>NotSupported</trans-attribute>
</container-transaction>

Published January 31, 2017 - Updated February 10, 2017

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.