<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">
<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>
                                <td>
                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="https://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>
                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px; -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
JCA Spec violation using resource-adapter in JBoss 7?
</h3>
<span style="margin-bottom: 10px;">
created by <a href="https://community.jboss.org/people/jleinawe">jleinawe</a> in <i>IronJacamar</i> - <a href="https://community.jboss.org/message/799730#799730">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">
<div class="jive-rendered-content"><p>JBoss AS 7.1.1.Final-SNAPSHOT</p><p>JBoss IronJacamar 1.0.8.Final</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Testing a JMS resource-adapter deployed to JBoss which will use WebLogic as the JMS provider.  In a transacted MDB test, this error appears in the JBoss log (which is attached) when the MDB tries to send and outbound reply message</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span style="color: #ff00ff;">11:18:24,023 ERROR [stderr] (default-short-running-threads-threads - 1) javax.transaction.xa.XAException: J2EE GJRA-01501: cause = Attempt to start a transaction while in an active (global or local) transaction.; action = Complete current transaction before starting another</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>By analysis our RA's own tracing, this looks like a JCA spec violation.  xaResourceWrapper2 (the XAResource for managedConnectionImpl0) is being enlisted with xid3.  Then without delisting xaResourceWrapper2, jboss is doing a managedConnectionImpl0.cleanup() call (which is a JCA spec violation).  Then later when it tries to enlist xaResourceWrapper2 with xid5, that fails because xaResourceWrapper2 is still enlisted with xid3.  (That enlistment attempt is not even getting to WebLogic JMS because the RA is detecting the XA protocol violation.)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Excerpts from log:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; font-size: 8pt;">   out:MessageEndpoint.beforeDelivery(public abstract void javax.jms.MessageListener.onMessage(javax.jms.Message)) #4 @1361560688075..1361560688295<br/>      in:xaResourceWrapper0.setTransactionTimeout(300) -> true #4 @1361560688102..1361560688173<br/>         out:XAResource.setTransactionTimeout(300) -> true #4 @1361560688126..1361560688155<br/>      in:xaResourceWrapper0.start(xid3,0) #4 @1361560688191..1361560688277 [TMNOFLAGS]<br/>         out:XAResource.start(xid3,0) #4 @1361560688223..1361560688260     [TMNOFLAGS]<br/>   [...]<br/>   out:MessageListener.onMessage(genericStreamMessage0) #1 @1361560697008..1361560702586<br/>      in:wlxaQueueConnectionFactory0.createConnection() -> wlConnection0 #1 @1361560698037..1361560700740<br/>         out:ConnectionManager.allocateConnection(wlManagedXAQueueConnectionFactory0,connectionRequestInfoImpl0) -> wlConnection0 #1 @1361560698093..1361560700687<br/>            [...]<br/>            <strong>in:managedConnectionImpl0.getXAResource() -> xaResourceWrapper2</strong> #1 @1361560699619..1361560699675<br/>            [...]<br/>            <strong>in:xaResourceWrapper2.start(xid3,2097152)</strong> #6 @1361560700092..1361560700275 [TMJOIN]<br/>               out:XAResource.start(xid3,2097152) #6 @1361560700157..1361560700226     [TMJOIN]<br/>   [...]<br/>   out:MessageEndpoint.afterDelivery() #4 @1361560702595..1361560702930<br/>      in:xaResourceWrapper0.end(xid3,67108864) #4 @1361560702612..1361560702709 [TMSUCCESS]<br/>         out:XAResource.end(xid3,67108864) #5 @1361560702649..1361560702688     [TMSUCCESS]<br/>      in:xaResourceWrapper0.commit(xid3,true) #4 @1361560702729..1361560702851<br/>         out:XAResource.commit(xid3,true) #4 @1361560702766..1361560702830<br/>      i<strong>n:managedConnectionImpl0.cleanup()</strong> #1 @1361560702871..1361560702904 [JCA spec violation]<br/>   out:MessageEndpoint.beforeDelivery(public abstract void javax.jms.MessageListener.onMessage(javax.jms.Message)) #6 @1361560702938..1361560703159<br/>      [...]<br/>   out:MessageConsumer.receive(15000) -> TextMessage[ID:<384827.1361560696991.0>, null] #6 @1361560703168..1361560703201<br/>   out:MessageListener.onMessage(genericTextMessage0) #2 @1361560703226..1361560704964<br/>      in:wlxaQueueConnectionFactory0.createConnection() threw #2 @1361560703250..1361560704672<br/>         out:ConnectionManager.allocateConnection(wlManagedXAQueueConnectionFactory0,connectionRequestInfoImpl0) threw #2 @1361560703307..1361560704447<br/>            [...]<br/>            i<strong>n:xaResourceWrapper2.start(xid5,2097152) threw</strong> #8 @1361560703786..1361560703871 [TMJOIN]<br/></span></p></div>
<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
<p style="margin: 0;">Reply to this message by <a href="https://community.jboss.org/message/799730#799730">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in IronJacamar at <a href="https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2098">Community</a></p>
</div></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>