You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by jpederzolli <jp...@gmail.com> on 2006/03/24 17:16:35 UTC
AMQ 3.2/Spring/Jencks/POJO and XA Transactions
I'm reposting this from the LogicBlaze forum...
I havent been able to get transactions to rollback and retry properly using
this combination of technologies. Below is the pertinent spring
configuration:
Code:
<bean id="jencks" class="org.jencks.JCAContainer">
<property name="bootstrapContext">
<bean class="org.jencks.factory.BootstrapContextFactoryBean">
<property name="threadPoolSize" value="25" />
</bean>
</property>
<property name="resourceAdapter" ref="resourceAdapter" />
</bean>
<bean id="resourceAdapter"
class="org.activemq.ra.ActiveMQResourceAdapter">
<property name="serverUrl" value="tcp://localhost:61616" />
</bean>
<bean id="transactionMdb" class="org.jencks.JCAConnector">
<property name="jcaContainer" ref="jencks" />
<property name="activationSpec">
<bean class="org.activemq.ra.ActiveMQActivationSpec">
<property name="destination" value="transactionQueue" />
<property name="destinationType" value="javax.jms.Queue" />
<property name="resourceAdapter" ref="resourceAdapter" />
</bean>
</property>
<property name="ref" value="consumer" />
<property name="transactionManager" ref="userTransaction" />
<property name="resourceAdapter" ref="resourceAdapter" />
</bean>
<bean id="consumer" class="com.test.Consumer"/>
<bean id="transactionContextManager"
class="org.jencks.factory.TransactionContextManagerFactoryBean" />
<bean id="userTransaction"
class="org.jencks.factory.GeronimoTransactionManagerFactoryBean" />
<bean id="jtaTransactionManager"
class="org.springframework.transaction.jta.JtaTransactionManager">
<property name="userTransaction" ref="userTransaction" />
</bean>
<bean id="jmsFactory" class="org.activemq.pool.PooledConnectionFactory">
<property name="connectionFactory">
<bean class="org.activemq.ActiveMQConnectionFactory">
<property name="brokerURL" value="tcp://localhost:61616" />
</bean>
</property>
</bean>
<bean id="transactionJmsTemplate"
class="org.springframework.jms.core.JmsTemplate">
<property name="connectionFactory" ref="jmsFactory"/>
<property name="defaultDestinationName" value="transactionQueue" />
<property name="deliveryPersistent" value="true" />
</bean>
I am throwing a RuntimeException in the onMessage() method of the POJO MDB
if a rollback should occur. The following is in the logs:
Code:
[DEBUG] 2006-03-22 12:05:11,810 - org.activemq.ra.ServerSessionImpl:0
(ServerSessionImpl.java:169)- Endpoint failed to process message.
java.lang.RuntimeException: Endpoint before delivery notification failure
at
org.activemq.ra.ServerSessionImpl.beforeDelivery(ServerSessionImpl.java:203)
at org.activemq.ActiveMQSession.run(ActiveMQSession.java:549)
at org.activemq.ra.ServerSessionImpl.run(ServerSessionImpl.java:165)
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: org.activemq.ra.InvalidMessageEndpointException
at
org.activemq.ra.MessageEndpointProxy$MessageEndpointDead.beforeDelivery(MessageEndpointProxy.java:182)
at
org.activemq.ra.MessageEndpointProxy.beforeDelivery(MessageEndpointProxy.java:70)
at
org.activemq.ra.ServerSessionImpl.beforeDelivery(ServerSessionImpl.java:201)
... 5 more
is there an issue with my spring configuration? Thanks for any help
--
View this message in context: http://www.nabble.com/AMQ-3.2-Spring-Jencks-POJO-and-XA-Transactions-t1337311.html#a3574167
Sent from the ActiveMQ - User forum at Nabble.com.
Re: AMQ 3.2/Spring/Jencks/POJO and XA Transactions
Posted by jpederzolli <jp...@gmail.com>.
I tried AMQ 4.0RC1 and had the following results:
throwing a runtiime exception in onMessage causes the following...
[WARN] 2006-03-24 14:41:09,180 - Transaction (TransactionImpl.java:526)-
Error ending association for XAResource
org.apache.geronimo.transaction.manager.WrapperNamedXAResource@16292a4;
transaction will roll back
javax.transaction.xa.XAException: The connection is already closed
at
org.apache.activemq.TransactionContext.toXAException(TransactionContext.java:589)
at
org.apache.activemq.TransactionContext.setXid(TransactionContext.java:554)
at org.apache.activemq.TransactionContext.end(TransactionContext.java:327)
at
org.apache.activemq.ra.LocalAndXATransaction.end(LocalAndXATransaction.java:89)
at
org.apache.geronimo.transaction.manager.WrapperNamedXAResource.end(WrapperNamedXAResource.java:51)
at
org.apache.geronimo.transaction.manager.TransactionImpl.endResources(TransactionImpl.java:524)
at
org.apache.geronimo.transaction.manager.TransactionImpl.endResources(TransactionImpl.java:503)
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:280)
at
org.apache.geronimo.transaction.context.InheritableTransactionContext.complete(InheritableTransactionContext.java:168)
at
org.apache.geronimo.transaction.context.InheritableTransactionContext.rollback(InheritableTransactionContext.java:149)
at
org.apache.geronimo.transaction.context.GeronimoTransactionManager.rollback(GeronimoTransactionManager.java:100)
at
org.apache.geronimo.transaction.context.GeronimoTransactionDelegate.rollback(GeronimoTransactionDelegate.java:74)
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)
Caused by: org.apache.activemq.ConnectionClosedException: The connection is
already closed
at
org.apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnection.java:1104)
at
org.apache.activemq.TransactionContext.setXid(TransactionContext.java:550)
... 23 more
[DEBUG] 2006-03-24 14:41:09,196 -
org.apache.activemq.transport.WireFormatNegotiator
(WireFormatNegotiator.java:85)- Received WireFormat: WireFormatInfo {
version=1, properties={StackTraceEnabled=true, TightEncodingEnabled=true,
TcpNoDelayEnabled=true, SizePrefixDisabled=false,
MaxInactivityDuration=30000, CacheEnabled=true}, magic=[A,c,t,i,v,e,M,Q]}
[DEBUG] 2006-03-24 14:41:09,196 -
activemq.broker.region.Queue.transactionQueue (Queue.java:398)- No
subscriptions registered, will not dispatch message at this time.
[DEBUG] 2006-03-24 14:41:09,196 -
org.apache.activemq.transport.WireFormatNegotiator
(WireFormatNegotiator.java:85)- Received WireFormat: WireFormatInfo {
version=1, properties={StackTraceEnabled=true, TightEncodingEnabled=true,
TcpNoDelayEnabled=true, SizePrefixDisabled=false,
MaxInactivityDuration=30000, CacheEnabled=true}, magic=[A,c,t,i,v,e,M,Q]}
[DEBUG] 2006-03-24 14:41:09,196 -
org.apache.activemq.transport.WireFormatNegotiator
(WireFormatNegotiator.java:92)- tcp:///127.0.0.1:2676 before negotiation:
OpenWireFormat{version=1, cacheEnabled=false, stackTraceEnabled=false,
tightEncodingEnabled=false, sizePrefixDisabled=false}
[DEBUG] 2006-03-24 14:41:09,196 - org.apache.activemq.TransactionContext
(TransactionContext.java:384)- Rollback:
[globalId=500000005748415420444f2057452043414c4c2049543f0000000000000000000000000000000000000,branchId=100000005748415420444f2057452043414c4c2049543f0000000000000000000000000000000000000]
[DEBUG] 2006-03-24 14:41:09,196 -
org.apache.activemq.transport.WireFormatNegotiator
(WireFormatNegotiator.java:92)- tcp://localhost/127.0.0.1:61616 before
negotiation: OpenWireFormat{version=1, cacheEnabled=false,
stackTraceEnabled=false, tightEncodingEnabled=false,
sizePrefixDisabled=false}
[DEBUG] 2006-03-24 14:41:09,196 -
apache.geronimo.connector.outbound.GeronimoConnectionEventListener
(GeronimoConnectionEventListener.java:64)- connectionClosed called with
org.apache.activemq.ra.ManagedConnectionProxy@1c480e8
[DEBUG] 2006-03-24 14:41:09,196 -
org.apache.activemq.transport.WireFormatNegotiator
(WireFormatNegotiator.java:103)- tcp:///127.0.0.1:2676 after negotiation:
OpenWireFormat{version=1, cacheEnabled=true, stackTraceEnabled=true,
tightEncodingEnabled=true, sizePrefixDisabled=false}
[ERROR] 2006-03-24 14:41:09,196 - Transaction (TransactionImpl.java:544)-
Unexpected exception rolling back
org.apache.geronimo.transaction.manager.WrapperNamedXAResource@16292a4;
continuing with rollback
javax.transaction.xa.XAException: The connection is already closed
at
org.apache.activemq.TransactionContext.toXAException(TransactionContext.java:589)
at
org.apache.activemq.TransactionContext.rollback(TransactionContext.java:414)
at
org.apache.activemq.ra.LocalAndXATransaction.rollback(LocalAndXATransaction.java:126)
at
org.apache.geronimo.transaction.manager.WrapperNamedXAResource.rollback(WrapperNamedXAResource.java:78)
at
org.apache.geronimo.transaction.manager.TransactionImpl.rollbackResources(TransactionImpl.java:542)
at
org.apache.geronimo.transaction.manager.TransactionImpl.rollback(TransactionImpl.java:446)
at
org.apache.geronimo.transaction.manager.TransactionManagerImpl.rollback(TransactionManagerImpl.java:155)
at
org.apache.geronimo.transaction.context.InheritableTransactionContext.isRolledback(InheritableTransactionContext.java:280)
at
org.apache.geronimo.transaction.context.InheritableTransactionContext.complete(InheritableTransactionContext.java:168)
at
org.apache.geronimo.transaction.context.InheritableTransactionContext.rollback(InheritableTransactionContext.java:149)
at
org.apache.geronimo.transaction.context.GeronimoTransactionManager.rollback(GeronimoTransactionManager.java:100)
at
org.apache.geronimo.transaction.context.GeronimoTransactionDelegate.rollback(GeronimoTransactionDelegate.java:74)
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)
Caused by: org.apache.activemq.ConnectionClosedException: The connection is
already closed
at
org.apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnection.java:1104)
at
org.apache.activemq.TransactionContext.rollback(TransactionContext.java:403)
... 21 more
[DEBUG] 2006-03-24 14:41:09,196 -
org.apache.activemq.transport.WireFormatNegotiator
(WireFormatNegotiator.java:103)- tcp://localhost/127.0.0.1:61616 after
negotiation: OpenWireFormat{version=1, cacheEnabled=true,
stackTraceEnabled=true, tightEncodingEnabled=true, sizePrefixDisabled=false}
[DEBUG] 2006-03-24 14:41:09,211 -
apache.geronimo.connector.outbound.SinglePoolConnectionInterceptor
(AbstractSinglePoolConnectionInterceptor.java:92)- returning
connectionorg.apache.activemq.ra.ManagedConnectionProxy@1c480e8
[ERROR] 2006-03-24 14:41:09,227 -
apache.geronimo.transaction.context.AbstractTransactionContext
(InheritableTransactionContext.java:308)- Unable to roll back transaction
java.lang.IllegalStateException: Status is STATUS_NO_TRANSACTION
at
org.apache.geronimo.transaction.manager.TransactionImpl.rollback(TransactionImpl.java:438)
at
org.apache.geronimo.transaction.context.InheritableTransactionContext.rollbackAndThrow(InheritableTransactionContext.java:305)
at
org.apache.geronimo.transaction.context.InheritableTransactionContext.complete(InheritableTransactionContext.java:196)
at
org.apache.geronimo.transaction.context.InheritableTransactionContext.rollback(InheritableTransactionContext.java:149)
at
org.apache.geronimo.transaction.context.GeronimoTransactionManager.rollback(GeronimoTransactionManager.java:100)
at
org.apache.geronimo.transaction.context.GeronimoTransactionDelegate.rollback(GeronimoTransactionDelegate.java:74)
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)
[WARN] 2006-03-24 14:41:09,258 - org.jencks.XAEndpoint
(XAEndpoint.java:136)- Failed to rollback transaction:
javax.transaction.SystemException
javax.transaction.SystemException
at
org.apache.geronimo.transaction.manager.TransactionImpl.rollbackResources(TransactionImpl.java:546)
at
org.apache.geronimo.transaction.manager.TransactionImpl.rollback(TransactionImpl.java:446)
at
org.apache.geronimo.transaction.manager.TransactionManagerImpl.rollback(TransactionManagerImpl.java:155)
at
org.apache.geronimo.transaction.context.InheritableTransactionContext.isRolledback(InheritableTransactionContext.java:280)
at
org.apache.geronimo.transaction.context.InheritableTransactionContext.complete(InheritableTransactionContext.java:168)
at
org.apache.geronimo.transaction.context.InheritableTransactionContext.rollback(InheritableTransactionContext.java:149)
at
org.apache.geronimo.transaction.context.GeronimoTransactionManager.rollback(GeronimoTransactionManager.java:100)
at
org.apache.geronimo.transaction.context.GeronimoTransactionDelegate.rollback(GeronimoTransactionDelegate.java:74)
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)
--
View this message in context: http://www.nabble.com/AMQ-3.2-Spring-Jencks-POJO-and-XA-Transactions-t1337311.html#a3579911
Sent from the ActiveMQ - User forum at Nabble.com.
Re: AMQ 3.2/Spring/Jencks/POJO and XA Transactions
Posted by John Pederzolli <jp...@gmail.com>.
https://issues.apache.org/activemq/browse/AMQ-662
That issue (plus my more recent comments) encompasses all the information I
can come up with so far.
Thanks - John
--
View this message in context: http://www.nabble.com/AMQ-3.2-Spring-Jencks-POJO-and-XA-Transactions-t1337311.html#a3770889
Sent from the ActiveMQ - User forum at Nabble.com.
Re: AMQ 3.2/Spring/Jencks/POJO and XA Transactions
Posted by John Pederzolli <jp...@gmail.com>.
Sounds good - As soon as a new snapshot is out there I will give it a shot.
- John
--
View this message in context: http://www.nabble.com/AMQ-3.2-Spring-Jencks-POJO-and-XA-Transactions-t1337311.html#a3775813
Sent from the ActiveMQ - User forum at Nabble.com.
Re: AMQ 3.2/Spring/Jencks/POJO and XA Transactions
Posted by James Strachan <ja...@gmail.com>.
Great - thanks for letting us know
James
On 4/6/06, John Pederzolli <jp...@gmail.com> wrote:
>
> Good news - it looks like the infinite loop issue has been fixed.
>
> Thank you for your help on this.
>
> - John
> --
> View this message in context: http://www.nabble.com/AMQ-3.2-Spring-Jencks-POJO-and-XA-Transactions-t1337311.html#a3786872
> Sent from the ActiveMQ - User forum at Nabble.com.
>
>
--
James
-------
http://radio.weblogs.com/0112098/
Re: AMQ 3.2/Spring/Jencks/POJO and XA Transactions
Posted by John Pederzolli <jp...@gmail.com>.
Good news - it looks like the infinite loop issue has been fixed.
Thank you for your help on this.
- John
--
View this message in context: http://www.nabble.com/AMQ-3.2-Spring-Jencks-POJO-and-XA-Transactions-t1337311.html#a3786872
Sent from the ActiveMQ - User forum at Nabble.com.
Re: AMQ 3.2/Spring/Jencks/POJO and XA Transactions
Posted by Hiram Chirino <hi...@hiramchirino.com>.
Thanks John,
I've just commited a change that I hope fixes the issue for you.
Please do a build from source or wait for the nightly snapshot, and
try again.
Regards,
Hiram
On 4/5/06, John Pederzolli <jp...@gmail.com> wrote:
>
> Also - As far as helping you test, that not a problem.
>
> - John
> --
> View this message in context: http://www.nabble.com/AMQ-3.2-Spring-Jencks-POJO-and-XA-Transactions-t1337311.html#a3772457
> Sent from the ActiveMQ - User forum at Nabble.com.
>
>
--
Regards,
Hiram
Re: AMQ 3.2/Spring/Jencks/POJO and XA Transactions
Posted by John Pederzolli <jp...@gmail.com>.
Also - As far as helping you test, that not a problem.
- John
--
View this message in context: http://www.nabble.com/AMQ-3.2-Spring-Jencks-POJO-and-XA-Transactions-t1337311.html#a3772457
Sent from the ActiveMQ - User forum at Nabble.com.
Re: AMQ 3.2/Spring/Jencks/POJO and XA Transactions
Posted by Hiram Chirino <hi...@hiramchirino.com>.
Hi John,
Thank for tracking this down. It's now begining to make more sense.
Could you open up a jira with the information that you've provided so
far? http://issues.apache.org/activemq/browse/AMQ
I'm working on a fix now.. would you be able to help me test it?
On 4/4/06, John Pederzolli <jp...@gmail.com> wrote:
>
> I have continued trying to solve this bug, and am currently running AMQ 4.0
> RC2.
>
> I found what seems to be the source of the infinite loop - in
> MessageDispatchChannel.java, in the method dequeueNoWait (line 91):
>
> public MessageDispatch dequeueNoWait() {
> synchronized (mutex) {
> if (closed || !running || list.isEmpty()) {
> return null;
> }
> return (MessageDispatch) list.removeFirst();
> }
> }
>
> The thread that keeps on spinning has values of closed=false, running=false,
> and a nonEmpty list. With those values, a null is returned up to the run()
> method of ActiveMqSession.java (line 640), causing it do do nothing and then
> finally up to ServerSessionImpl.java's run() method (line 156) where in the
> finally block the following code that is responsible for breaking out of the
> while loop (line 170):
>
> finally {
> InboundContextSupport.unregister(this);
> log.debug("run loop end");
> synchronized (runControlMutex) {
> // This endpoint may have gone stale due to error
> if( stale) {
> runningFlag = false;
> pool.removeFromPool(this);
> break;
> }
> if( !session.hasUncomsumedMessages() ) {
> runningFlag = false;
> pool.returnToPool(this);
> break;
> }
> }
>
> Neither break statement is hit since the endpoint is not stale and it has
> unconsumed messages - and the infinite loop begins.
>
> I am not familiar enough with the code to say their is a bug in any of the
> classes I just mentioned or there is an external class which is causing the
> problem. Do you have any insight into this? I am more than willing to assist
> or give additional debug information if needed.
>
> - John
>
>
> --
> View this message in context: http://www.nabble.com/AMQ-3.2-Spring-Jencks-POJO-and-XA-Transactions-t1337311.html#a3747724
> Sent from the ActiveMQ - User forum at Nabble.com.
>
>
--
Regards,
Hiram
Re: AMQ 3.2/Spring/Jencks/POJO and XA Transactions
Posted by John Pederzolli <jp...@gmail.com>.
I have continued trying to solve this bug, and am currently running AMQ 4.0
RC2.
I found what seems to be the source of the infinite loop - in
MessageDispatchChannel.java, in the method dequeueNoWait (line 91):
public MessageDispatch dequeueNoWait() {
synchronized (mutex) {
if (closed || !running || list.isEmpty()) {
return null;
}
return (MessageDispatch) list.removeFirst();
}
}
The thread that keeps on spinning has values of closed=false, running=false,
and a nonEmpty list. With those values, a null is returned up to the run()
method of ActiveMqSession.java (line 640), causing it do do nothing and then
finally up to ServerSessionImpl.java's run() method (line 156) where in the
finally block the following code that is responsible for breaking out of the
while loop (line 170):
finally {
InboundContextSupport.unregister(this);
log.debug("run loop end");
synchronized (runControlMutex) {
// This endpoint may have gone stale due to error
if( stale) {
runningFlag = false;
pool.removeFromPool(this);
break;
}
if( !session.hasUncomsumedMessages() ) {
runningFlag = false;
pool.returnToPool(this);
break;
}
}
Neither break statement is hit since the endpoint is not stale and it has
unconsumed messages - and the infinite loop begins.
I am not familiar enough with the code to say their is a bug in any of the
classes I just mentioned or there is an external class which is causing the
problem. Do you have any insight into this? I am more than willing to assist
or give additional debug information if needed.
- John
--
View this message in context: http://www.nabble.com/AMQ-3.2-Spring-Jencks-POJO-and-XA-Transactions-t1337311.html#a3747724
Sent from the ActiveMQ - User forum at Nabble.com.
Re: AMQ 3.2/Spring/Jencks/POJO and XA Transactions
Posted by John Pederzolli <jp...@gmail.com>.
I will work on it. The problem with this is that I can only get this behavior
to occur in the servlet container with Jencks. I can successfully run all
the unit tests concerning redelivery included in the AMQ 4RC1 source outside
this environment.
I opened a Jira issue (https://issues.apache.org/activemq/browse/AMQ-662)
and included my activemq and spring configuration files.
- John
--
View this message in context: http://www.nabble.com/AMQ-3.2-Spring-Jencks-POJO-and-XA-Transactions-t1337311.html#a3672948
Sent from the ActiveMQ - User forum at Nabble.com.
Re: AMQ 3.2/Spring/Jencks/POJO and XA Transactions
Posted by James Strachan <ja...@gmail.com>.
Any chance you could provide us with a JUnit test case that reproduces this bug?
James
On 3/24/06, jpederzolli <jp...@gmail.com> wrote:
>
> I got further with 4.0 RC1 -
>
> The good news is I sent 20 messages through, caused 4 to fail and can see
> they were successfully reprocessed.
>
> The bad news is that the ActiveMQ appears to go into an infinite loop at
> this point, and takes up 100% of the CPU. turning debug on reveals the
> following messages being logged nonstop:
>
> [DEBUG] 2006-03-21 16:55:37,586 -
> org.apache.activemq.ra.ServerSessionImpl:1 (ServerSessionImpl.java:159)- run
> loop start
> [DEBUG] 2006-03-21 16:55:37,586 - org.apache.activemq.ra.ServerSessionImpl:3
> (ServerSessionImpl.java:172)- run loop end
> [DEBUG] 2006-03-21 16:55:37,586 -
> org.apache.activemq.ra.ServerSessionImpl:22 (ServerSessionImpl.java:172)-
> run loop end
> [DEBUG] 2006-03-21 16:55:37,586 -
> org.apache.activemq.ra.ServerSessionImpl:11 (ServerSessionImpl.java:159)-
> run loop start
> [DEBUG] 2006-03-21 16:55:37,586 - org.apache.activemq.ra.ServerSessionImpl:0
> (ServerSessionImpl.java:172)- run loop end
> [DEBUG] 2006-03-21 16:55:37,586 -
> org.apache.activemq.ra.ServerSessionImpl:17 (ServerSessionImpl.java:172)-
> run loop end
> [DEBUG] 2006-03-21 16:55:37,586 - org.apache.activemq.ra.ServerSessionImpl:1
> (ServerSessionImpl.java:172)- run loop end
>
> Again, thanks for any help.
> --
> View this message in context: http://www.nabble.com/AMQ-3.2-Spring-Jencks-POJO-and-XA-Transactions-t1337311.html#a3580396
> Sent from the ActiveMQ - User forum at Nabble.com.
>
>
--
James
-------
http://radio.weblogs.com/0112098/
Re: AMQ 3.2/Spring/Jencks/POJO and XA Transactions
Posted by jpederzolli <jp...@gmail.com>.
I got further with 4.0 RC1 -
The good news is I sent 20 messages through, caused 4 to fail and can see
they were successfully reprocessed.
The bad news is that the ActiveMQ appears to go into an infinite loop at
this point, and takes up 100% of the CPU. turning debug on reveals the
following messages being logged nonstop:
[DEBUG] 2006-03-21 16:55:37,586 -
org.apache.activemq.ra.ServerSessionImpl:1 (ServerSessionImpl.java:159)- run
loop start
[DEBUG] 2006-03-21 16:55:37,586 - org.apache.activemq.ra.ServerSessionImpl:3
(ServerSessionImpl.java:172)- run loop end
[DEBUG] 2006-03-21 16:55:37,586 -
org.apache.activemq.ra.ServerSessionImpl:22 (ServerSessionImpl.java:172)-
run loop end
[DEBUG] 2006-03-21 16:55:37,586 -
org.apache.activemq.ra.ServerSessionImpl:11 (ServerSessionImpl.java:159)-
run loop start
[DEBUG] 2006-03-21 16:55:37,586 - org.apache.activemq.ra.ServerSessionImpl:0
(ServerSessionImpl.java:172)- run loop end
[DEBUG] 2006-03-21 16:55:37,586 -
org.apache.activemq.ra.ServerSessionImpl:17 (ServerSessionImpl.java:172)-
run loop end
[DEBUG] 2006-03-21 16:55:37,586 - org.apache.activemq.ra.ServerSessionImpl:1
(ServerSessionImpl.java:172)- run loop end
Again, thanks for any help.
--
View this message in context: http://www.nabble.com/AMQ-3.2-Spring-Jencks-POJO-and-XA-Transactions-t1337311.html#a3580396
Sent from the ActiveMQ - User forum at Nabble.com.
Re: AMQ 3.2/Spring/Jencks/POJO and XA Transactions
Posted by James Strachan <ja...@gmail.com>.
I know we found and fixed a number of JCA Resource Adapter issues to
do with dealing with exceptions on endpoints; I wonder could you try
out using ActiveMQ 4.0-RC1 to see if you can reproduce this in the new
version of ActiveMQ?
http://people.apache.org/~chirino/incubator-activemq-4.0-RC1/
The main change is the package rename from "org.activemq" to
"org.apache.activemq"....
http://activemq.org/Changes+in+4.0
James
On 3/24/06, jpederzolli <jp...@gmail.com> wrote:
>
> I'm reposting this from the LogicBlaze forum...
>
> I havent been able to get transactions to rollback and retry properly using
> this combination of technologies. Below is the pertinent spring
> configuration:
>
> Code:
>
> <bean id="jencks" class="org.jencks.JCAContainer">
> <property name="bootstrapContext">
> <bean class="org.jencks.factory.BootstrapContextFactoryBean">
> <property name="threadPoolSize" value="25" />
> </bean>
> </property>
> <property name="resourceAdapter" ref="resourceAdapter" />
> </bean>
>
> <bean id="resourceAdapter"
> class="org.activemq.ra.ActiveMQResourceAdapter">
> <property name="serverUrl" value="tcp://localhost:61616" />
> </bean>
>
> <bean id="transactionMdb" class="org.jencks.JCAConnector">
> <property name="jcaContainer" ref="jencks" />
> <property name="activationSpec">
> <bean class="org.activemq.ra.ActiveMQActivationSpec">
> <property name="destination" value="transactionQueue" />
> <property name="destinationType" value="javax.jms.Queue" />
> <property name="resourceAdapter" ref="resourceAdapter" />
> </bean>
> </property>
> <property name="ref" value="consumer" />
> <property name="transactionManager" ref="userTransaction" />
> <property name="resourceAdapter" ref="resourceAdapter" />
> </bean>
>
> <bean id="consumer" class="com.test.Consumer"/>
>
>
> <bean id="transactionContextManager"
> class="org.jencks.factory.TransactionContextManagerFactoryBean" />
> <bean id="userTransaction"
> class="org.jencks.factory.GeronimoTransactionManagerFactoryBean" />
> <bean id="jtaTransactionManager"
> class="org.springframework.transaction.jta.JtaTransactionManager">
> <property name="userTransaction" ref="userTransaction" />
> </bean>
>
> <bean id="jmsFactory" class="org.activemq.pool.PooledConnectionFactory">
> <property name="connectionFactory">
> <bean class="org.activemq.ActiveMQConnectionFactory">
> <property name="brokerURL" value="tcp://localhost:61616" />
> </bean>
> </property>
> </bean>
>
> <bean id="transactionJmsTemplate"
> class="org.springframework.jms.core.JmsTemplate">
> <property name="connectionFactory" ref="jmsFactory"/>
> <property name="defaultDestinationName" value="transactionQueue" />
> <property name="deliveryPersistent" value="true" />
> </bean>
>
>
>
>
> I am throwing a RuntimeException in the onMessage() method of the POJO MDB
> if a rollback should occur. The following is in the logs:
>
> Code:
>
> [DEBUG] 2006-03-22 12:05:11,810 - org.activemq.ra.ServerSessionImpl:0
> (ServerSessionImpl.java:169)- Endpoint failed to process message.
> java.lang.RuntimeException: Endpoint before delivery notification failure
> at
> org.activemq.ra.ServerSessionImpl.beforeDelivery(ServerSessionImpl.java:203)
> at org.activemq.ActiveMQSession.run(ActiveMQSession.java:549)
> at org.activemq.ra.ServerSessionImpl.run(ServerSessionImpl.java:165)
> 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: org.activemq.ra.InvalidMessageEndpointException
> at
> org.activemq.ra.MessageEndpointProxy$MessageEndpointDead.beforeDelivery(MessageEndpointProxy.java:182)
> at
> org.activemq.ra.MessageEndpointProxy.beforeDelivery(MessageEndpointProxy.java:70)
> at
> org.activemq.ra.ServerSessionImpl.beforeDelivery(ServerSessionImpl.java:201)
> ... 5 more
>
>
>
>
> is there an issue with my spring configuration? Thanks for any help
> --
> View this message in context: http://www.nabble.com/AMQ-3.2-Spring-Jencks-POJO-and-XA-Transactions-t1337311.html#a3574167
> Sent from the ActiveMQ - User forum at Nabble.com.
>
>
--
James
-------
http://radio.weblogs.com/0112098/