You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Terry Cox <te...@meta-concepts.com> on 2006/09/05 12:03:57 UTC

Transactions and flows

I am not getting the container behaviour I expected, so I just want to 
check my understanding. We have a container configured for SEDA and JCA 
flows "seda,jca?jmsURL=tcp://localhost:61616".

We route messages from a JmsInUsingJCABinding to a lw-component 
asynchronously within a transaction. If we then try to create a 
synchronous connection from the lw-component to a servicemix-http 
component we get the following error:

"Flow 'Seda' was specified but is not able to handle exchange."

I thought from our previous discussions that we should be able to make a 
synchronous transactional call within the scope of a previously started 
asynchronous transaction if both flows are specified?

Terry

Re: Transactions and flows

Posted by Guillaume Nodet <gn...@gmail.com>.
This error happens when the org.apache.servicemix.flow property is
set on the exchange.  This property is set when the flow is first
chosen (when the exchange goes through the NMR for this first time).
A single exchange may not be conveyed by several flows during
its lifecycle.
If the jca BC sends the exchange asynchronously, the exchange
will be send on the jca flow.  The lw-component will be able to
sendSync the exchange to servicemix-http using the seda flow,
but the http BC has to use sendSync too, to ensure the seda flow
is used on the answer.
Does this error happen when the servicemix-http send the response ?
I think it always use send and not sendSync when possible, so
this case may have been forgotten...  If this is the case, I will fix it
asap.

On 9/5/06, Terry Cox <te...@meta-concepts.com> wrote:
>
> I am not getting the container behaviour I expected, so I just want to
> check my understanding. We have a container configured for SEDA and JCA
> flows "seda,jca?jmsURL=tcp://localhost:61616".
>
> We route messages from a JmsInUsingJCABinding to a lw-component
> asynchronously within a transaction. If we then try to create a
> synchronous connection from the lw-component to a servicemix-http
> component we get the following error:
>
> "Flow 'Seda' was specified but is not able to handle exchange."
>
> I thought from our previous discussions that we should be able to make a
> synchronous transactional call within the scope of a previously started
> asynchronous transaction if both flows are specified?
>
> Terry
>



-- 
Cheers,
Guillaume Nodet

Re: Transactions and flows

Posted by Guillaume Nodet <gn...@gmail.com>.
Looking at the first stack trace, it seems there is a bugsomewhere ;)
However, I don't know which component fails (jencks, geronimo tm,
activemq, servicemix).  I don't think it prevents the transaction to
actually
roll back, as shown a few lines later.
The problem comes from the fact that the
   org.apache.activemq.TransactionContext.end(TransactionContext.java:318)
method is called twice, and the second time throws this exception
(which seems fine because the xa resource has already been delisted).
If you could set a breakpoint or print the stack trace to know who is
calling this method the first time, it would help a lot.

The second and third exceptions can be safely ignored.  The second one
catches the exception caused by the rollback, and the last one will
discard the endpoint as there was a failure.  They will always be logged
at debug level when a rollback occur.

On 9/7/06, Terry Cox <te...@meta-concepts.com> wrote:
>
> We had a message exchange conversation that wasn't being completed.
> However, despite this, if we do choose to setRollbackOnly(), we get
>
> "Error ending association for XAResource
> org.apache.activemq.ra.LocalAndXATransaction@8be9ef; transaction will
> roll back. XA error code: -6"
>
> Full stack trace follows:
>
> 11:08:02,164 | DEBUG | Thread-6         | DeliveryChannelImpl
>     | bi.messaging.DeliveryChannelImpl  344 | Sent: InOut[
>    id: ID:workstation22155.uk.x.com-33371-1157623660369-10:0
>    status: Active
>    role: provider
>    service: {http://uk.x.com/ott/1.1}sgmbHttpOut
>    endpoint: sgmbHttpOut
>    in: <?xml version="1.0"
> encoding="UTF-8"?><SUBMIT-REQUEST></SUBMIT-REQUEST>
>    out: <?xml version="1.0" encoding="UTF-8"?><SUBMIT-RESPONSE
> status="FAIL"></SUBMIT-RESPONSE>
> ]
> 11:08:02,165 | DEBUG | Thread-6         | SedaFlow
>     | icemix.jbi.nmr.flow.AbstractFlow  116 | Called Flow send
> 11:08:02,166 | DEBUG | Thread-6         | SedaFlow
>     | cemix.jbi.nmr.flow.seda.SedaFlow  301 | Suspending transaction for
> ID:workstation22155.uk.x.com-33371-1157623660369-10:0 in
> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow@19480b8
> 11:08:02,173 | DEBUG | Thread-10        | SedaQueue
>     | ix.jbi.nmr.flow.seda.SedaQueue$1  225 |
> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1@78529d dequeued
> exchange: InOut[
>    id: ID:workstation22155.uk.x.com-33371-1157623660369-10:0
>    status: Active
>    role: consumer
>    service: {http://uk.x.com/ott/1.1}sgmbHttpOut
>    endpoint: sgmbHttpOut
>    in: <?xml version="1.0"
> encoding="UTF-8"?><SUBMIT-REQUEST></SUBMIT-REQUEST>
>    out: <?xml version="1.0" encoding="UTF-8"?><SUBMIT-RESPONSE
> status="FAIL">
> </SUBMIT-RESPONSE>
> ]
> 11:08:02,174 | DEBUG | Thread-10        | SedaFlow
>     | cemix.jbi.nmr.flow.seda.SedaFlow  321 | Resuming transaction for
> ID:workstation22155.uk.x.com-33371-1157623660369-10:0 in
> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow@19480b8
> 11:08:02,179 | DEBUG | Thread-10        | DeliveryChannelImpl
>     | bi.messaging.DeliveryChannelImpl  578 | Processing inbound
> exchange: InOut[
>    id: ID:workstation22155.uk.x.com-33371-1157623660369-10:0
>    status: Active
>    role: consumer
>    service: {http://uk.x.com/ott/1.1}sgmbHttpOut
>    endpoint: sgmbHttpOut
>    in: <?xml version="1.0"
> encoding="UTF-8"?><SUBMIT-REQUEST></SUBMIT-REQUEST>
>    out: <?xml version="1.0" encoding="UTF-8"?><SUBMIT-RESPONSE
> status="FAIL"></SUBMIT-RESPONSE>
> ]
> 11:08:02,180 | DEBUG | Thread-10        | DeliveryChannelImpl
>     | bi.messaging.DeliveryChannelImpl  746 | Suspending transaction for
> ID:workstation22155.uk.x.com-33371-1157623660369-10:0 in
> DeliveryChannel{sgmbOutMessageHandler}
> 11:08:02,180 | DEBUG | Thread-10        | DeliveryChannelImpl
>     | bi.messaging.DeliveryChannelImpl  720 | Notifying exchange
> ID:workstation22155.uk.x.com-33371-1157623660369-10:0(d1a1ab) in
> DeliveryChannel{sgmbOutMessageHandler} from
> processInboundSynchronousExchange
> 11:08:02,182 | DEBUG | Thread-7         | DeliveryChannelImpl
>     | bi.messaging.DeliveryChannelImpl  714 | Notified:
> ID:workstation22155.uk.x.com-33371-1157623660369-10:0(d1a1ab) in
> DeliveryChannel{sgmbOutMessageHandler} from sendSync
> 11:08:02,183 | DEBUG | Thread-7         | DeliveryChannelImpl
>     | bi.messaging.DeliveryChannelImpl  767 | Resuming transaction for
> ID:workstation22155.k.x.com-33371-1157623660369-10:0 in
> DeliveryChannel{sgmbOutMessageHandler}
> INFO:[SGMBMessageHandler] - Printing acknowledgement : true
> 11:08:02,185 | DEBUG | Thread-7         | DeliveryChannelImpl
>     | bi.messaging.DeliveryChannelImpl  405 | Send
> ID:workstation22155.uk.x.com-33371-1157623660369-10:0 in
> DeliveryChannel{sgmbOutMessageHandler}
> 11:08:02,189 | DEBUG | Thread-7         | DeliveryChannelImpl
>     | bi.messaging.DeliveryChannelImpl  344 | Sent: InOut[
>    id: ID:workstation22155.uk.x.com-33371-1157623660369-10:0
>    status: Done
>    role: consumer
>    service: {http://uk.x.com/ott/1.1}sgmbHttpOut
>    endpoint: sgmbHttpOut
>    in: <?xml version="1.0"
> encoding="UTF-8"?><SUBMIT-REQUEST></SUBMIT-REQUEST>
>    out: <?xml version="1.0" encoding="UTF-8"?><SUBMIT-RESPONSE
> status="FAIL"></SUBMIT-RESPONSE>
> ]
> 11:08:02,191 | DEBUG | Thread-7         | SedaFlow
>     | icemix.jbi.nmr.flow.AbstractFlow  116 | Called Flow send
> INFO:[SGMBMessageHandler] - Message sent successfully. Acknowledgement
> received.
> INFO:[SGMBMessageHandler] - Printing acknowledgement below :
> <?xml version="1.0" encoding="UTF-8"?><SUBMIT-RESPONSE
> status="FAIL"></SUBMIT-RESPONSE>
> INFO:[SGMBMessageHandler] - Rolling the transaction back.
> 11:08:02,197 | DEBUG | Thread-7         | TransactionContext
>     | ache.activemq.TransactionContext  310 | End:
>
> [globalId=200000005555ffffffbf0a416ffffff9b000000000000000000000000000000000000000000000000,branchId=100000005555ffffffbf0a416ffffff9b000000000000000000000000000000000000000000000000]
> 11:08:02,199 | DEBUG | Thread-7         | TransactionContext
>     | ache.activemq.TransactionContext  552 | Ended XA transaction:
>
> XID:1197822575:02000000000000005555bf000a04169b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000:01000000000000005555bf000a04169b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
> 11:08:02,201 | DEBUG | Thread-7         | TransactionContext
>     | ache.activemq.TransactionContext  310 | End:
>
> [globalId=200000005555ffffffbf0a416ffffff9b000000000000000000000000000000000000000000000000,branchId=100000005555ffffffbf0a416ffffff9b000000000000000000000000000000000000000000000000]
> 11:08:02,203 | WARN  | Thread-7         | Transaction
>     | nsaction.manager.TransactionImpl  526 | Error ending association
> for XAResource org.apache.activemq.ra.LocalAndXATransaction@8be9ef;
> transaction will roll back. XA error code: -6
> javax.transaction.xa.XAException
>      at
> org.apache.activemq.TransactionContext.end(TransactionContext.java:318)
>      at
> org.apache.activemq.ra.LocalAndXATransaction.end(
> LocalAndXATransaction.java:89)
>      at
> org.apache.geronimo.transaction.manager.TransactionImpl.endResources(
> TransactionImpl.java:524)
>      at
> org.apache.geronimo.transaction.manager.TransactionImpl.endResources(
> TransactionImpl.java:504)
>      at
> org.apache.geronimo.transaction.manager.TransactionImpl.rollback(
> TransactionImpl.java:444)
>      at
> org.apache.geronimo.transaction.manager.TransactionManagerImpl.rollback(
> TransactionManagerImpl.java:155)
>      at
>
> org.apache.geronimo.transaction.context.InheritableTransactionContext.isRolledback
> (InheritableTransactionContext.java:283)
>      at
>
> org.apache.geronimo.transaction.context.InheritableTransactionContext.complete
> (InheritableTransactionContext.java:171)
>      at
>
> org.apache.geronimo.transaction.context.InheritableTransactionContext.commit
> (InheritableTransactionContext.java:146)
>      at
> org.apache.geronimo.transaction.context.GeronimoTransactionManager.commit(
> GeronimoTransactionManager.java:81)
>      at
> org.apache.geronimo.transaction.context.GeronimoTransactionDelegate.commit
> (GeronimoTransactionDelegate.java:51)
>      at org.jencks.XAEndpoint.afterDelivery(XAEndpoint.java:103)
>      at
>
> org.apache.activemq.ra.MessageEndpointProxy$MessageEndpointAlive.afterDelivery
> (MessageEndpointProxy.java:125)
>      at
> org.apache.activemq.ra.MessageEndpointProxy.afterDelivery(
> MessageEndpointProxy.java:64)
>      at
> org.apache.activemq.ra.ServerSessionImpl.afterDelivery(
> ServerSessionImpl.java:214)
>      at org.apache.activemq.ActiveMQSession.run(ActiveMQSession.java:723)
>      at
> org.apache.activemq.ra.ServerSessionImpl.run(ServerSessionImpl.java:163)
>      at
> org.apache.geronimo.connector.work.WorkerContext.run(WorkerContext.java
> :291)
>      at
> EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(Unknown Source)
>      at java.lang.Thread.run(Thread.java:595)
> 11:08:02,214 | DEBUG | Thread-7         | TransactionContext
>     | ache.activemq.TransactionContext  384 | Rollback:
>
> [globalId=200000005555ffffffbf0a416ffffff9b000000000000000000000000000000000000000000000000,branchId=100000005555ffffffbf0a416ffffff9b000000000000000000000000000000000000000000000000]
> 11:08:02,218 | DEBUG | /127.0.0.1:33397 | XATransaction
>     | tivemq.transaction.XATransaction  125 | XA Transaction rollback:
>
> XID:1197822575:02000000000000005555bf000a04169b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000:01000000000000005555bf000a04169b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
> 11:08:02,221 | DEBUG | Thread-7         | ServerSessionImpl:2
>     | he.activemq.ra.ServerSessionImpl  167 | Endpoint failed to process
> message.
> java.lang.RuntimeException: Endpoint after delivery notification failure
>      at
> org.apache.activemq.ra.ServerSessionImpl.afterDelivery(
> ServerSessionImpl.java:216)
>      at org.apache.activemq.ActiveMQSession.run(ActiveMQSession.java:723)
>      at
> org.apache.activemq.ra.ServerSessionImpl.run(ServerSessionImpl.java:163)
>      at
> org.apache.geronimo.connector.work.WorkerContext.run(WorkerContext.java
> :291)
>      at
> EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(Unknown Source)
>      at java.lang.Thread.run(Thread.java:595)
> Caused by: javax.transaction.RollbackException
>      at org.jencks.XAEndpoint.afterDelivery(XAEndpoint.java:107)
>      at
>
> org.apache.activemq.ra.MessageEndpointProxy$MessageEndpointAlive.afterDelivery
> (MessageEndpointProxy.java:125)
>      at
> org.apache.activemq.ra.MessageEndpointProxy.afterDelivery(
> MessageEndpointProxy.java:64)
>      at
> org.apache.activemq.ra.ServerSessionImpl.afterDelivery(
> ServerSessionImpl.java:214)
>      ... 5 more
> Caused by: javax.transaction.RollbackException
>      at
> org.apache.geronimo.transaction.context.GeronimoTransactionManager.commit(
> GeronimoTransactionManager.java:82)
>      at
> org.apache.geronimo.transaction.context.GeronimoTransactionDelegate.commit
> (GeronimoTransactionDelegate.java:51)
>      at org.jencks.XAEndpoint.afterDelivery(XAEndpoint.java:103)
>      ... 8 more
> 11:08:02,222 | INFO  | Thread-7         | ServerSessionImpl:2
>     | he.activemq.ra.ServerSessionImpl  168 | Endpoint failed to process
> message. Reason: java.lang.RuntimeException: Endpoint after delivery
> notification failure
> 11:08:02,223 | DEBUG | Thread-7         | ServerSessionImpl:2
>     | he.activemq.ra.ServerSessionImpl  172 | run loop end
> 11:08:02,223 | DEBUG | Thread-7         | ServerSessionImpl:2
>     | he.activemq.ra.ServerSessionImpl  252 | Endpoint did not release
> properly: org.apache.activemq.ra.InvalidMessageEndpointException
> org.apache.activemq.ra.InvalidMessageEndpointException
>      at
> org.apache.activemq.ra.MessageEndpointProxy$MessageEndpointDead.release(
> MessageEndpointProxy.java:156)
>      at
> org.apache.activemq.ra.MessageEndpointProxy.release(
> MessageEndpointProxy.java:68)
>      at
> org.apache.activemq.ra.ServerSessionImpl.close(ServerSessionImpl.java:250)
>      at
> org.apache.activemq.ra.ServerSessionPoolImpl.removeFromPool(
> ServerSessionPoolImpl.java:180)
>      at
> org.apache.activemq.ra.ServerSessionImpl.run(ServerSessionImpl.java:177)
>      at
> org.apache.geronimo.connector.work.WorkerContext.run(WorkerContext.java
> :291)
>      at
> EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(Unknown Source)
>      at java.lang.Thread.run(Thread.java:595)
> 11:08:02,224 | DEBUG | Thread-7         | ServerSessionImpl:2
>     | he.activemq.ra.ServerSessionImpl  188 | Run finished
>



-- 
Cheers,
Guillaume Nodet

Re: Transactions and flows

Posted by Terry Cox <te...@meta-concepts.com>.
We had a message exchange conversation that wasn't being completed. 
However, despite this, if we do choose to setRollbackOnly(), we get

"Error ending association for XAResource 
org.apache.activemq.ra.LocalAndXATransaction@8be9ef; transaction will 
roll back. XA error code: -6"

Full stack trace follows:

11:08:02,164 | DEBUG | Thread-6         | DeliveryChannelImpl 
    | bi.messaging.DeliveryChannelImpl  344 | Sent: InOut[
   id: ID:workstation22155.uk.x.com-33371-1157623660369-10:0
   status: Active
   role: provider
   service: {http://uk.x.com/ott/1.1}sgmbHttpOut
   endpoint: sgmbHttpOut
   in: <?xml version="1.0" 
encoding="UTF-8"?><SUBMIT-REQUEST></SUBMIT-REQUEST>
   out: <?xml version="1.0" encoding="UTF-8"?><SUBMIT-RESPONSE 
status="FAIL"></SUBMIT-RESPONSE>
]
11:08:02,165 | DEBUG | Thread-6         | SedaFlow 
    | icemix.jbi.nmr.flow.AbstractFlow  116 | Called Flow send
11:08:02,166 | DEBUG | Thread-6         | SedaFlow 
    | cemix.jbi.nmr.flow.seda.SedaFlow  301 | Suspending transaction for 
ID:workstation22155.uk.x.com-33371-1157623660369-10:0 in 
org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow@19480b8
11:08:02,173 | DEBUG | Thread-10        | SedaQueue 
    | ix.jbi.nmr.flow.seda.SedaQueue$1  225 | 
org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1@78529d dequeued 
exchange: InOut[
   id: ID:workstation22155.uk.x.com-33371-1157623660369-10:0
   status: Active
   role: consumer
   service: {http://uk.x.com/ott/1.1}sgmbHttpOut
   endpoint: sgmbHttpOut
   in: <?xml version="1.0" 
encoding="UTF-8"?><SUBMIT-REQUEST></SUBMIT-REQUEST>
   out: <?xml version="1.0" encoding="UTF-8"?><SUBMIT-RESPONSE 
status="FAIL">
</SUBMIT-RESPONSE>
]
11:08:02,174 | DEBUG | Thread-10        | SedaFlow 
    | cemix.jbi.nmr.flow.seda.SedaFlow  321 | Resuming transaction for 
ID:workstation22155.uk.x.com-33371-1157623660369-10:0 in 
org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow@19480b8
11:08:02,179 | DEBUG | Thread-10        | DeliveryChannelImpl 
    | bi.messaging.DeliveryChannelImpl  578 | Processing inbound 
exchange: InOut[
   id: ID:workstation22155.uk.x.com-33371-1157623660369-10:0
   status: Active
   role: consumer
   service: {http://uk.x.com/ott/1.1}sgmbHttpOut
   endpoint: sgmbHttpOut
   in: <?xml version="1.0" 
encoding="UTF-8"?><SUBMIT-REQUEST></SUBMIT-REQUEST>
   out: <?xml version="1.0" encoding="UTF-8"?><SUBMIT-RESPONSE 
status="FAIL"></SUBMIT-RESPONSE>
]
11:08:02,180 | DEBUG | Thread-10        | DeliveryChannelImpl 
    | bi.messaging.DeliveryChannelImpl  746 | Suspending transaction for 
ID:workstation22155.uk.x.com-33371-1157623660369-10:0 in 
DeliveryChannel{sgmbOutMessageHandler}
11:08:02,180 | DEBUG | Thread-10        | DeliveryChannelImpl 
    | bi.messaging.DeliveryChannelImpl  720 | Notifying exchange 
ID:workstation22155.uk.x.com-33371-1157623660369-10:0(d1a1ab) in 
DeliveryChannel{sgmbOutMessageHandler} from 
processInboundSynchronousExchange
11:08:02,182 | DEBUG | Thread-7         | DeliveryChannelImpl 
    | bi.messaging.DeliveryChannelImpl  714 | Notified: 
ID:workstation22155.uk.x.com-33371-1157623660369-10:0(d1a1ab) in 
DeliveryChannel{sgmbOutMessageHandler} from sendSync
11:08:02,183 | DEBUG | Thread-7         | DeliveryChannelImpl 
    | bi.messaging.DeliveryChannelImpl  767 | Resuming transaction for 
ID:workstation22155.k.x.com-33371-1157623660369-10:0 in 
DeliveryChannel{sgmbOutMessageHandler}
INFO:[SGMBMessageHandler] - Printing acknowledgement : true
11:08:02,185 | DEBUG | Thread-7         | DeliveryChannelImpl 
    | bi.messaging.DeliveryChannelImpl  405 | Send 
ID:workstation22155.uk.x.com-33371-1157623660369-10:0 in 
DeliveryChannel{sgmbOutMessageHandler}
11:08:02,189 | DEBUG | Thread-7         | DeliveryChannelImpl 
    | bi.messaging.DeliveryChannelImpl  344 | Sent: InOut[
   id: ID:workstation22155.uk.x.com-33371-1157623660369-10:0
   status: Done
   role: consumer
   service: {http://uk.x.com/ott/1.1}sgmbHttpOut
   endpoint: sgmbHttpOut
   in: <?xml version="1.0" 
encoding="UTF-8"?><SUBMIT-REQUEST></SUBMIT-REQUEST>
   out: <?xml version="1.0" encoding="UTF-8"?><SUBMIT-RESPONSE 
status="FAIL"></SUBMIT-RESPONSE>
]
11:08:02,191 | DEBUG | Thread-7         | SedaFlow 
    | icemix.jbi.nmr.flow.AbstractFlow  116 | Called Flow send
INFO:[SGMBMessageHandler] - Message sent successfully. Acknowledgement 
received.
INFO:[SGMBMessageHandler] - Printing acknowledgement below :
<?xml version="1.0" encoding="UTF-8"?><SUBMIT-RESPONSE 
status="FAIL"></SUBMIT-RESPONSE>
INFO:[SGMBMessageHandler] - Rolling the transaction back.
11:08:02,197 | DEBUG | Thread-7         | TransactionContext 
    | ache.activemq.TransactionContext  310 | End: 
[globalId=200000005555ffffffbf0a416ffffff9b000000000000000000000000000000000000000000000000,branchId=100000005555ffffffbf0a416ffffff9b000000000000000000000000000000000000000000000000]
11:08:02,199 | DEBUG | Thread-7         | TransactionContext 
    | ache.activemq.TransactionContext  552 | Ended XA transaction: 
XID:1197822575:02000000000000005555bf000a04169b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000:01000000000000005555bf000a04169b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
11:08:02,201 | DEBUG | Thread-7         | TransactionContext 
    | ache.activemq.TransactionContext  310 | End: 
[globalId=200000005555ffffffbf0a416ffffff9b000000000000000000000000000000000000000000000000,branchId=100000005555ffffffbf0a416ffffff9b000000000000000000000000000000000000000000000000]
11:08:02,203 | WARN  | Thread-7         | Transaction 
    | nsaction.manager.TransactionImpl  526 | Error ending association 
for XAResource org.apache.activemq.ra.LocalAndXATransaction@8be9ef; 
transaction will roll back. XA error code: -6
javax.transaction.xa.XAException
     at 
org.apache.activemq.TransactionContext.end(TransactionContext.java:318)
     at 
org.apache.activemq.ra.LocalAndXATransaction.end(LocalAndXATransaction.java:89)
     at 
org.apache.geronimo.transaction.manager.TransactionImpl.endResources(TransactionImpl.java:524)
     at 
org.apache.geronimo.transaction.manager.TransactionImpl.endResources(TransactionImpl.java:504)
     at 
org.apache.geronimo.transaction.manager.TransactionImpl.rollback(TransactionImpl.java:444)
     at 
org.apache.geronimo.transaction.manager.TransactionManagerImpl.rollback(TransactionManagerImpl.java:155)
     at 
org.apache.geronimo.transaction.context.InheritableTransactionContext.isRolledback(InheritableTransactionContext.java:283)
     at 
org.apache.geronimo.transaction.context.InheritableTransactionContext.complete(InheritableTransactionContext.java:171)
     at 
org.apache.geronimo.transaction.context.InheritableTransactionContext.commit(InheritableTransactionContext.java:146)
     at 
org.apache.geronimo.transaction.context.GeronimoTransactionManager.commit(GeronimoTransactionManager.java:81)
     at 
org.apache.geronimo.transaction.context.GeronimoTransactionDelegate.commit(GeronimoTransactionDelegate.java:51)
     at org.jencks.XAEndpoint.afterDelivery(XAEndpoint.java:103)
     at 
org.apache.activemq.ra.MessageEndpointProxy$MessageEndpointAlive.afterDelivery(MessageEndpointProxy.java:125)
     at 
org.apache.activemq.ra.MessageEndpointProxy.afterDelivery(MessageEndpointProxy.java:64)
     at 
org.apache.activemq.ra.ServerSessionImpl.afterDelivery(ServerSessionImpl.java:214)
     at org.apache.activemq.ActiveMQSession.run(ActiveMQSession.java:723)
     at 
org.apache.activemq.ra.ServerSessionImpl.run(ServerSessionImpl.java:163)
     at 
org.apache.geronimo.connector.work.WorkerContext.run(WorkerContext.java:291)
     at 
EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(Unknown Source)
     at java.lang.Thread.run(Thread.java:595)
11:08:02,214 | DEBUG | Thread-7         | TransactionContext 
    | ache.activemq.TransactionContext  384 | Rollback: 
[globalId=200000005555ffffffbf0a416ffffff9b000000000000000000000000000000000000000000000000,branchId=100000005555ffffffbf0a416ffffff9b000000000000000000000000000000000000000000000000]
11:08:02,218 | DEBUG | /127.0.0.1:33397 | XATransaction 
    | tivemq.transaction.XATransaction  125 | XA Transaction rollback: 
XID:1197822575:02000000000000005555bf000a04169b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000:01000000000000005555bf000a04169b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
11:08:02,221 | DEBUG | Thread-7         | ServerSessionImpl:2 
    | he.activemq.ra.ServerSessionImpl  167 | Endpoint failed to process 
message.
java.lang.RuntimeException: Endpoint after delivery notification failure
     at 
org.apache.activemq.ra.ServerSessionImpl.afterDelivery(ServerSessionImpl.java:216)
     at org.apache.activemq.ActiveMQSession.run(ActiveMQSession.java:723)
     at 
org.apache.activemq.ra.ServerSessionImpl.run(ServerSessionImpl.java:163)
     at 
org.apache.geronimo.connector.work.WorkerContext.run(WorkerContext.java:291)
     at 
EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(Unknown Source)
     at java.lang.Thread.run(Thread.java:595)
Caused by: javax.transaction.RollbackException
     at org.jencks.XAEndpoint.afterDelivery(XAEndpoint.java:107)
     at 
org.apache.activemq.ra.MessageEndpointProxy$MessageEndpointAlive.afterDelivery(MessageEndpointProxy.java:125)
     at 
org.apache.activemq.ra.MessageEndpointProxy.afterDelivery(MessageEndpointProxy.java:64)
     at 
org.apache.activemq.ra.ServerSessionImpl.afterDelivery(ServerSessionImpl.java:214)
     ... 5 more
Caused by: javax.transaction.RollbackException
     at 
org.apache.geronimo.transaction.context.GeronimoTransactionManager.commit(GeronimoTransactionManager.java:82)
     at 
org.apache.geronimo.transaction.context.GeronimoTransactionDelegate.commit(GeronimoTransactionDelegate.java:51)
     at org.jencks.XAEndpoint.afterDelivery(XAEndpoint.java:103)
     ... 8 more
11:08:02,222 | INFO  | Thread-7         | ServerSessionImpl:2 
    | he.activemq.ra.ServerSessionImpl  168 | Endpoint failed to process 
message. Reason: java.lang.RuntimeException: Endpoint after delivery 
notification failure
11:08:02,223 | DEBUG | Thread-7         | ServerSessionImpl:2 
    | he.activemq.ra.ServerSessionImpl  172 | run loop end
11:08:02,223 | DEBUG | Thread-7         | ServerSessionImpl:2 
    | he.activemq.ra.ServerSessionImpl  252 | Endpoint did not release 
properly: org.apache.activemq.ra.InvalidMessageEndpointException
org.apache.activemq.ra.InvalidMessageEndpointException
     at 
org.apache.activemq.ra.MessageEndpointProxy$MessageEndpointDead.release(MessageEndpointProxy.java:156)
     at 
org.apache.activemq.ra.MessageEndpointProxy.release(MessageEndpointProxy.java:68)
     at 
org.apache.activemq.ra.ServerSessionImpl.close(ServerSessionImpl.java:250)
     at 
org.apache.activemq.ra.ServerSessionPoolImpl.removeFromPool(ServerSessionPoolImpl.java:180)
     at 
org.apache.activemq.ra.ServerSessionImpl.run(ServerSessionImpl.java:177)
     at 
org.apache.geronimo.connector.work.WorkerContext.run(WorkerContext.java:291)
     at 
EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(Unknown Source)
     at java.lang.Thread.run(Thread.java:595)
11:08:02,224 | DEBUG | Thread-7         | ServerSessionImpl:2 
    | he.activemq.ra.ServerSessionImpl  188 | Run finished

Re: Transactions and flows

Posted by Guillaume Nodet <gn...@gmail.com>.
Do you actually rollback the transaction ?
If yes, you should try to flag the transaction as rollback only:
   transactionManager.setRollbackOnly()
or
   transaction.setRollbackOnly()

If you manually commit / rollback the transaction, you will have
weird behavior, as the jca container is responsible for that.

On 9/6/06, Terry Cox <te...@meta-concepts.com> wrote:
>
> > This is fixed  :)
>
> Thanks. That has moved us forward again.
>
> If we throw an error in the process and try to roll the transaction back
> onto the queue, we see a conflict where one component seems to be trying
> to heuristically commit instead of rolling back:
>
> 13:58:48,788 | DEBUG | Thread-7         | TransactionContext
>     | ache.activemq.TransactionContext  384 | Rollback:
>
> [globalId=200000005555ffffffbf0a416ffffff9b000000000000000000000000000000000000000000000000,branchId=100000005555ffffffbf0a416ffffff9b000000000000000000000000000000000000000000000000]
> 13:58:48,792 | DEBUG | /127.0.0.1:36345 | XATransaction
>     | tivemq.transaction.XATransaction  125 | XA Transaction rollback:
>
> XID:1197822575:02000000000000005555bf000a04169b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000:01000000000000005555bf000a04169b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
> 13:58:48,793 | WARN  | Thread-7         | ServerSessionImpl:3
>     | he.activemq.ra.ServerSessionImpl  222 | Local transaction had not
> been commited.  Commiting now.
> 13:58:48,797 | DEBUG | Thread-2         | DeliveryChannelImpl
>     | bi.messaging.DeliveryChannelImpl  578 | Processing inbound
> exchange: InOut[
>    id: ID:workstation22155.36319-1157547512819-10:0
>    status: Done
>    role: provider
>    service: {http://uk.x.com/ott/1.1}sgmbHttpOut
>    endpoint: sgmbHttpOut
>    in: <?xml version="1.0"
> encoding="UTF-8"?><SUBMIT-REQUEST></SUBMIT-REQUEST>
>    out: <?xml version="1.0" encoding="UTF-8"?><SUBMIT-RESPONSE
> status="FAIL"></SUBMIT-RESPONSE>
> ]
> 13:58:48,798 | DEBUG | Thread-2         | DeliveryChannelImpl
>     | bi.messaging.DeliveryChannelImpl  720 | Notifying exchange
> ID:workstation22155.-36319-1157547512819-10:0(156d7c8) in
> DeliveryChannel{sgmbHttpOut} from processInboundSynchronousExchange
> 13:58:48,799 | DEBUG | Thread-8         | DeliveryChannelImpl
>     | bi.messaging.DeliveryChannelImpl  714 | Notified:
> ID:workstation22155.36319-1157547512819-10:0(156d7c8) in
> DeliveryChannel{sgmbHttpOut} from sendSync
> 13:58:48,834 | DEBUG | Thread-7         | ServerSessionImpl:3
>     | he.activemq.ra.ServerSessionImpl  167 | Endpoint failed to process
> message.
> java.lang.RuntimeException: Endpoint after delivery notification failure
>      at
> org.apache.activemq.ra.ServerSessionImpl.afterDelivery(
> ServerSessionImpl.java:216)
>      at org.apache.activemq.ActiveMQSession.run(ActiveMQSession.java:723)
>      at
> org.apache.activemq.ra.ServerSessionImpl.run(ServerSessionImpl.java:163)
>      at
> org.apache.geronimo.connector.work.WorkerContext.run(WorkerContext.java
> :291)
>      at
> EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(Unknown Source)
>      at java.lang.Thread.run(Thread.java:595)
> Caused by: java.lang.IllegalStateException: There is no transaction in
> progress.
>      at
>
> org.apache.geronimo.transaction.context.InheritableTransactionContext.delistResource
> (InheritableTransactionContext.java:97)
>      at
>
> org.apache.geronimo.transaction.context.GeronimoTransactionDelegate.delistResource
> (GeronimoTransactionDelegate.java:55)
>      at org.jencks.XAEndpoint.afterDelivery(XAEndpoint.java:97)
>      at
>
> org.apache.activemq.ra.MessageEndpointProxy$MessageEndpointAlive.afterDelivery
> (MessageEndpointProxy.java:125)
>      at
> org.apache.activemq.ra.MessageEndpointProxy.afterDelivery(
> MessageEndpointProxy.java:64)
>      at
> org.apache.activemq.ra.ServerSessionImpl.afterDelivery(
> ServerSessionImpl.java:214)
>      ... 5 more
> 13:58:48,835 | INFO  | Thread-7         | ServerSessionImpl:3
>     | he.activemq.ra.ServerSessionImpl  168 | Endpoint failed to process
> message. Reason: java.lang.RuntimeException: Endpoint after delivery
> notification failure
> 13:58:48,836 | DEBUG | Thread-7         | ServerSessionImpl:3
>     | he.activemq.ra.ServerSessionImpl  172 | run loop end
> 13:58:48,836 | DEBUG | Thread-7         | ServerSessionImpl:3
>     | he.activemq.ra.ServerSessionImpl  252 | Endpoint did not release
> properly: java.lang.IllegalStateException: Cannot commit if the
> transaction is not bound to the current thread
> java.lang.IllegalStateException: Cannot commit if the transaction is not
> bound to the current thread
>      at
>
> org.apache.geronimo.transaction.context.GeronimoTransactionDelegate.rollback
> (GeronimoTransactionDelegate.java:72)
>      at org.jencks.XAEndpoint.release(XAEndpoint.java:133)
>      at
> org.apache.activemq.ra.MessageEndpointProxy$MessageEndpointDead.enter(
> MessageEndpointProxy.java:140)
>      at
>
> org.apache.activemq.ra.MessageEndpointProxy$MessageEndpointState.transition
> (MessageEndpointProxy.java:98)
>      at
> org.apache.activemq.ra.MessageEndpointProxy$MessageEndpointAlive.release(
> MessageEndpointProxy.java:133)
>      at
> org.apache.activemq.ra.MessageEndpointProxy.release(
> MessageEndpointProxy.java:68)
>      at
> org.apache.activemq.ra.ServerSessionImpl.close(ServerSessionImpl.java:250)
>      at
> org.apache.activemq.ra.ServerSessionPoolImpl.removeFromPool(
> ServerSessionPoolImpl.java:180)
>      at
> org.apache.activemq.ra.ServerSessionImpl.run(ServerSessionImpl.java:177)
>      at
> org.apache.geronimo.connector.work.WorkerContext.run(WorkerContext.java
> :291)
>      at
> EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(Unknown Source)
>      at java.lang.Thread.run(Thread.java:595)
>
>
>
> Not sure if this is a bug, or just us not handling a message exchange
> completely.
>
> Terry
>



-- 
Cheers,
Guillaume Nodet

Re: Transactions and flows

Posted by Terry Cox <te...@meta-concepts.com>.
> This is fixed  :)

Thanks. That has moved us forward again.

If we throw an error in the process and try to roll the transaction back 
onto the queue, we see a conflict where one component seems to be trying 
to heuristically commit instead of rolling back:

13:58:48,788 | DEBUG | Thread-7         | TransactionContext 
    | ache.activemq.TransactionContext  384 | Rollback: 
[globalId=200000005555ffffffbf0a416ffffff9b000000000000000000000000000000000000000000000000,branchId=100000005555ffffffbf0a416ffffff9b000000000000000000000000000000000000000000000000]
13:58:48,792 | DEBUG | /127.0.0.1:36345 | XATransaction 
    | tivemq.transaction.XATransaction  125 | XA Transaction rollback: 
XID:1197822575:02000000000000005555bf000a04169b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000:01000000000000005555bf000a04169b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
13:58:48,793 | WARN  | Thread-7         | ServerSessionImpl:3 
    | he.activemq.ra.ServerSessionImpl  222 | Local transaction had not 
been commited.  Commiting now.
13:58:48,797 | DEBUG | Thread-2         | DeliveryChannelImpl 
    | bi.messaging.DeliveryChannelImpl  578 | Processing inbound 
exchange: InOut[
   id: ID:workstation22155.36319-1157547512819-10:0
   status: Done
   role: provider
   service: {http://uk.x.com/ott/1.1}sgmbHttpOut
   endpoint: sgmbHttpOut
   in: <?xml version="1.0" 
encoding="UTF-8"?><SUBMIT-REQUEST></SUBMIT-REQUEST>
   out: <?xml version="1.0" encoding="UTF-8"?><SUBMIT-RESPONSE 
status="FAIL"></SUBMIT-RESPONSE>
]
13:58:48,798 | DEBUG | Thread-2         | DeliveryChannelImpl 
    | bi.messaging.DeliveryChannelImpl  720 | Notifying exchange 
ID:workstation22155.-36319-1157547512819-10:0(156d7c8) in 
DeliveryChannel{sgmbHttpOut} from processInboundSynchronousExchange
13:58:48,799 | DEBUG | Thread-8         | DeliveryChannelImpl 
    | bi.messaging.DeliveryChannelImpl  714 | Notified: 
ID:workstation22155.36319-1157547512819-10:0(156d7c8) in 
DeliveryChannel{sgmbHttpOut} from sendSync
13:58:48,834 | DEBUG | Thread-7         | ServerSessionImpl:3 
    | he.activemq.ra.ServerSessionImpl  167 | Endpoint failed to process 
message.
java.lang.RuntimeException: Endpoint after delivery notification failure
     at 
org.apache.activemq.ra.ServerSessionImpl.afterDelivery(ServerSessionImpl.java:216)
     at org.apache.activemq.ActiveMQSession.run(ActiveMQSession.java:723)
     at 
org.apache.activemq.ra.ServerSessionImpl.run(ServerSessionImpl.java:163)
     at 
org.apache.geronimo.connector.work.WorkerContext.run(WorkerContext.java:291)
     at 
EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(Unknown Source)
     at java.lang.Thread.run(Thread.java:595)
Caused by: java.lang.IllegalStateException: There is no transaction in 
progress.
     at 
org.apache.geronimo.transaction.context.InheritableTransactionContext.delistResource(InheritableTransactionContext.java:97)
     at 
org.apache.geronimo.transaction.context.GeronimoTransactionDelegate.delistResource(GeronimoTransactionDelegate.java:55)
     at org.jencks.XAEndpoint.afterDelivery(XAEndpoint.java:97)
     at 
org.apache.activemq.ra.MessageEndpointProxy$MessageEndpointAlive.afterDelivery(MessageEndpointProxy.java:125)
     at 
org.apache.activemq.ra.MessageEndpointProxy.afterDelivery(MessageEndpointProxy.java:64)
     at 
org.apache.activemq.ra.ServerSessionImpl.afterDelivery(ServerSessionImpl.java:214)
     ... 5 more
13:58:48,835 | INFO  | Thread-7         | ServerSessionImpl:3 
    | he.activemq.ra.ServerSessionImpl  168 | Endpoint failed to process 
message. Reason: java.lang.RuntimeException: Endpoint after delivery 
notification failure
13:58:48,836 | DEBUG | Thread-7         | ServerSessionImpl:3 
    | he.activemq.ra.ServerSessionImpl  172 | run loop end
13:58:48,836 | DEBUG | Thread-7         | ServerSessionImpl:3 
    | he.activemq.ra.ServerSessionImpl  252 | Endpoint did not release 
properly: java.lang.IllegalStateException: Cannot commit if the 
transaction is not bound to the current thread
java.lang.IllegalStateException: Cannot commit if the transaction is not 
bound to the current thread
     at 
org.apache.geronimo.transaction.context.GeronimoTransactionDelegate.rollback(GeronimoTransactionDelegate.java:72)
     at org.jencks.XAEndpoint.release(XAEndpoint.java:133)
     at 
org.apache.activemq.ra.MessageEndpointProxy$MessageEndpointDead.enter(MessageEndpointProxy.java:140)
     at 
org.apache.activemq.ra.MessageEndpointProxy$MessageEndpointState.transition(MessageEndpointProxy.java:98)
     at 
org.apache.activemq.ra.MessageEndpointProxy$MessageEndpointAlive.release(MessageEndpointProxy.java:133)
     at 
org.apache.activemq.ra.MessageEndpointProxy.release(MessageEndpointProxy.java:68)
     at 
org.apache.activemq.ra.ServerSessionImpl.close(ServerSessionImpl.java:250)
     at 
org.apache.activemq.ra.ServerSessionPoolImpl.removeFromPool(ServerSessionPoolImpl.java:180)
     at 
org.apache.activemq.ra.ServerSessionImpl.run(ServerSessionImpl.java:177)
     at 
org.apache.geronimo.connector.work.WorkerContext.run(WorkerContext.java:291)
     at 
EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(Unknown Source)
     at java.lang.Thread.run(Thread.java:595)



Not sure if this is a bug, or just us not handling a message exchange 
completely.

Terry

Re: Transactions and flows

Posted by Guillaume Nodet <gn...@gmail.com>.
This is fixed :)

On 9/5/06, Terry Cox <te...@meta-concepts.com> wrote:
>
> I am not getting the container behaviour I expected, so I just want to
> check my understanding. We have a container configured for SEDA and JCA
> flows "seda,jca?jmsURL=tcp://localhost:61616".
>
> We route messages from a JmsInUsingJCABinding to a lw-component
> asynchronously within a transaction. If we then try to create a
> synchronous connection from the lw-component to a servicemix-http
> component we get the following error:
>
> "Flow 'Seda' was specified but is not able to handle exchange."
>
> I thought from our previous discussions that we should be able to make a
> synchronous transactional call within the scope of a previously started
> asynchronous transaction if both flows are specified?
>
> Terry
>



-- 
Cheers,
Guillaume Nodet