activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rob Davies <rajdav...@gmail.com>
Subject Re: Messages delivery to JBoss MDB stopped after an exception
Date Thu, 17 Apr 2008 12:44:03 GMT

On 17 Apr 2008, at 09:42, srouil wrote:

>
> Hi all,
>
> I have configured Active MQ 5.0.0 integration in JBoss AS 4.0.5  
> according to
> http://activemq.apache.org/integrating-apache-activemq-with- 
> jboss.html.
>
> I modified also jboss.xml deployment descriptor so that my MDB uses
> "Standard Message Inflow Driven Bean" container configuration and
> "message-inflow-driven-bean" invoker proxy binding of JBoss:
>
> <message-driven>
>  <ejb-name>SimpleQueueConsumer</ejb-name>
>  <resource-adapter-name>activemq-ra.rar</resource-adapter-name>
>  <configuration-name>Standard Message Inflow Driven
> Bean</configuration-name>
> </message-driven>
>
> With this setup, everything works fine until I simulate a  
> RuntimeException
> exception beeing thrown from MDB onMessage() method. When doing this  
> I see
> that:
> - Message remains in queue (=> OK)
> - No further message is delivered to my MDB
> - Subscription to queue for my MDB does not exist anymore (checked  
> using
> jconsole / JMX)
>
> JBoss server log contains following error:
>
> 2008-04-17 07:03:06,143 ERROR [org.apache.activemq.ActiveMQSession]
> (WorkManager(3)-10:) error dispatching message:
> javax.ejb.TransactionRolledbackLocalException: bye
> 	at
> org 
> .jboss 
> .ejb 
> .plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java: 
> 262)
> 	at
> org 
> .jboss 
> .ejb 
> .plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java: 
> 350)
> 	at  
> org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java: 
> 181)
> 	at
> org 
> .jboss 
> .ejb 
> .plugins 
> .RunAsSecurityInterceptor.invoke(RunAsSecurityInterceptor.java:109)
> 	at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java: 
> 205)
> 	at
> org 
> .jboss 
> .ejb 
> .plugins 
> .ProxyFactoryFinderInterceptor 
> .invoke(ProxyFactoryFinderInterceptor.java:136)
> 	at
> org 
> .jboss 
> .ejb 
> .MessageDrivenContainer.internalInvoke(MessageDrivenContainer.java: 
> 402)
> 	at org.jboss.ejb.Container.invoke(Container.java:954)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at
> sun 
> .reflect 
> .NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at
> sun 
> .reflect 
> .DelegatingMethodAccessorImpl 
> .invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:585)
> 	at
> org 
> .jboss 
> .mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java: 
> 155)
> 	at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
> 	at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
> 	at
> org 
> .jboss 
> .mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
> 	at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java: 
> 659)
> 	at
> org.jboss.invocation.local.LocalInvoker 
> $MBeanServerAction.invoke(LocalInvoker.java:169)
> 	at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java: 
> 118)
> 	at
> org 
> .jboss 
> .invocation.InvokerInterceptor.invokeLocal(InvokerInterceptor.java: 
> 209)
> 	at
> org 
> .jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java: 
> 195)
> 	at
> org 
> .jboss 
> .proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:61)
> 	at
> org 
> .jboss 
> .ejb 
> .plugins 
> .inflow 
> .MessageEndpointInterceptor.delivery(MessageEndpointInterceptor.java: 
> 263)
> 	at
> org 
> .jboss 
> .ejb 
> .plugins 
> .inflow 
> .MessageEndpointInterceptor.invoke(MessageEndpointInterceptor.java: 
> 140)
> 	at
> org 
> .jboss 
> .proxy.ClientMethodInterceptor.invoke(ClientMethodInterceptor.java:74)
> 	at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:100)
> 	at $Proxy85.onMessage(Unknown Source)
> 	at
> org.apache.activemq.ra.MessageEndpointProxy 
> $MessageEndpointAlive.onMessage(MessageEndpointProxy.java:116)
> 	at
> org 
> .apache 
> .activemq 
> .ra.MessageEndpointProxy.onMessage(MessageEndpointProxy.java:59)
> 	at org.apache.activemq.ActiveMQSession.run(ActiveMQSession.java:727)
> 	at  
> org.apache.activemq.ra.ServerSessionImpl.run(ServerSessionImpl.java: 
> 164)
> 	at org.jboss.resource.work.WorkWrapper.execute(WorkWrapper.java:204)
> 	at
> org.jboss.util.threadpool.BasicTaskWrapper.run(BasicTaskWrapper.java: 
> 275)
> 	at
> EDU.oswego.cs.dl.util.concurrent.PooledExecutor 
> $Worker.run(PooledExecutor.java:743)
> 	at java.lang.Thread.run(Thread.java:595)
> Caused by: java.lang.RuntimeException: bye
> 	at
> com 
> .acsinc 
> .test 
> .jms 
> .ejb.SimpleQueueConsumerBean.onMessage(SimpleQueueConsumerBean.java: 
> 59)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at
> sun 
> .reflect 
> .NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at
> sun 
> .reflect 
> .DelegatingMethodAccessorImpl 
> .invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:585)
> 	at org.jboss.invocation.Invocation.performCall(Invocation.java:359)
> 	at
> org.jboss.ejb.MessageDrivenContainer 
> $ContainerInterceptor.invoke(MessageDrivenContainer.java:495)
> 	at
> org 
> .jboss 
> .resource 
> .connectionmanager 
> .CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java: 
> 158)
> 	at
> org 
> .jboss 
> .ejb 
> .plugins 
> .MessageDrivenInstanceInterceptor 
> .invoke(MessageDrivenInstanceInterceptor.java:116)
> 	at
> org 
> .jboss 
> .ejb 
> .plugins 
> .CallValidationInterceptor.invoke(CallValidationInterceptor.java:63)
> 	at
> org 
> .jboss 
> .ejb 
> .plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java: 
> 121)
> 	... 34 more
> 2008-04-17 07:03:06,174 INFO   
> [org.apache.activemq.ra.ServerSessionImpl:1]
> (WorkManager(3)-10:) Endpoint failed to process message. Reason:
> java.lang.RuntimeException: Endpoint after delivery notification  
> failure
> 2008-04-17 07:03:06,180 WARN  [org.jboss.tm.TransactionImpl]
> (WorkManager(3)-10:) XAException:  
> tx=TransactionImpl:XidImpl[FormatId=257,
> GlobalId=WS007/5, BranchQual=, localId=5] errorCode=XAER_RMFAIL
> javax.transaction.xa.XAException: The connection is already closed
> 	at
> org 
> .apache 
> .activemq.TransactionContext.toXAException(TransactionContext.java: 
> 624)
> 	at
> org 
> .apache.activemq.TransactionContext.setXid(TransactionContext.java: 
> 559)
> 	at  
> org.apache.activemq.TransactionContext.end(TransactionContext.java: 
> 339)
> 	at
> org 
> .apache 
> .activemq.ra.LocalAndXATransaction.end(LocalAndXATransaction.java:90)
> 	at
> org.jboss.tm.TransactionImpl 
> $Resource.endResource(TransactionImpl.java:2143)
> 	at
> org.jboss.tm.TransactionImpl 
> $Resource.endResource(TransactionImpl.java:2118)
> 	at org.jboss.tm.TransactionImpl.endResources(TransactionImpl.java: 
> 1462)
> 	at org.jboss.tm.TransactionImpl.rollback(TransactionImpl.java:411)
> 	at org.jboss.tm.TxManager.rollback(TxManager.java:364)
> 	at
> org 
> .jboss 
> .ejb 
> .plugins 
> .inflow 
> .MessageEndpointInterceptor 
> .endTransaction(MessageEndpointInterceptor.java:430)
> 	at
> org 
> .jboss 
> .ejb 
> .plugins 
> .inflow 
> .MessageEndpointInterceptor.finish(MessageEndpointInterceptor.java: 
> 308)
> 	at
> org 
> .jboss 
> .ejb 
> .plugins 
> .inflow 
> .MessageEndpointInterceptor.release(MessageEndpointInterceptor.java: 
> 166)
> 	at
> org 
> .jboss 
> .ejb 
> .plugins 
> .inflow 
> .MessageEndpointInterceptor.invoke(MessageEndpointInterceptor.java: 
> 126)
> 	at
> org 
> .jboss 
> .proxy.ClientMethodInterceptor.invoke(ClientMethodInterceptor.java:74)
> 	at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:100)
> 	at $Proxy85.release(Unknown Source)
> 	at
> org.apache.activemq.ra.MessageEndpointProxy 
> $MessageEndpointDead.enter(MessageEndpointProxy.java:136)
> 	at
> org.apache.activemq.ra.MessageEndpointProxy 
> $MessageEndpointState.transition(MessageEndpointProxy.java:94)
> 	at
> org.apache.activemq.ra.MessageEndpointProxy 
> $MessageEndpointAlive.release(MessageEndpointProxy.java:129)
> 	at
> org 
> .apache 
> .activemq.ra.MessageEndpointProxy.release(MessageEndpointProxy.java: 
> 67)
> 	at
> org 
> .apache.activemq.ra.ServerSessionImpl.close(ServerSessionImpl.java: 
> 250)
> 	at
> org 
> .apache 
> .activemq 
> .ra.ServerSessionPoolImpl.removeFromPool(ServerSessionPoolImpl.java: 
> 181)
> 	at  
> org.apache.activemq.ra.ServerSessionImpl.run(ServerSessionImpl.java: 
> 176)
> 	at org.jboss.resource.work.WorkWrapper.execute(WorkWrapper.java:204)
> 	at
> org.jboss.util.threadpool.BasicTaskWrapper.run(BasicTaskWrapper.java: 
> 275)
> 	at
> EDU.oswego.cs.dl.util.concurrent.PooledExecutor 
> $Worker.run(PooledExecutor.java:743)
> 	at java.lang.Thread.run(Thread.java:595)
> Caused by: org.apache.activemq.ConnectionClosedException: The  
> connection is
> already closed
> 	at
> org 
> .apache 
> .activemq.ActiveMQConnection.checkClosed(ActiveMQConnection.java:1244)
> 	at
> org 
> .apache 
> .activemq 
> .ActiveMQConnection.checkClosedOrFailed(ActiveMQConnection.java:1231)
> 	at
> org 
> .apache.activemq.TransactionContext.setXid(TransactionContext.java: 
> 556)
> 	... 25 more
> 2008-04-17 07:03:06,209 WARN  [org.jboss.tm.TransactionImpl]
> (WorkManager(3)-10:) XAException:  
> tx=TransactionImpl:XidImpl[FormatId=257,
> GlobalId=WS007/5, BranchQual=, localId=5] errorCode=XAER_RMFAIL
> javax.transaction.xa.XAException: The connection is already closed
> 	at
> org 
> .apache 
> .activemq.TransactionContext.toXAException(TransactionContext.java: 
> 624)
> 	at
> org 
> .apache.activemq.TransactionContext.rollback(TransactionContext.java: 
> 423)
> 	at
> org 
> .apache 
> .activemq 
> .ra.LocalAndXATransaction.rollback(LocalAndXATransaction.java:128)
> 	at
> org.jboss.tm.TransactionImpl$Resource.rollback(TransactionImpl.java: 
> 2277)
> 	at
> org.jboss.tm.TransactionImpl.rollbackResources(TransactionImpl.java: 
> 1837)
> 	at org.jboss.tm.TransactionImpl.rollback(TransactionImpl.java:412)
> 	at org.jboss.tm.TxManager.rollback(TxManager.java:364)
> 	at
> org 
> .jboss 
> .ejb 
> .plugins 
> .inflow 
> .MessageEndpointInterceptor 
> .endTransaction(MessageEndpointInterceptor.java:430)
> 	at
> org 
> .jboss 
> .ejb 
> .plugins 
> .inflow 
> .MessageEndpointInterceptor.finish(MessageEndpointInterceptor.java: 
> 308)
> 	at
> org 
> .jboss 
> .ejb 
> .plugins 
> .inflow 
> .MessageEndpointInterceptor.release(MessageEndpointInterceptor.java: 
> 166)
> 	at
> org 
> .jboss 
> .ejb 
> .plugins 
> .inflow 
> .MessageEndpointInterceptor.invoke(MessageEndpointInterceptor.java: 
> 126)
> 	at
> org 
> .jboss 
> .proxy.ClientMethodInterceptor.invoke(ClientMethodInterceptor.java:74)
> 	at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:100)
> 	at $Proxy85.release(Unknown Source)
> 	at
> org.apache.activemq.ra.MessageEndpointProxy 
> $MessageEndpointDead.enter(MessageEndpointProxy.java:136)
> 	at
> org.apache.activemq.ra.MessageEndpointProxy 
> $MessageEndpointState.transition(MessageEndpointProxy.java:94)
> 	at
> org.apache.activemq.ra.MessageEndpointProxy 
> $MessageEndpointAlive.release(MessageEndpointProxy.java:129)
> 	at
> org 
> .apache 
> .activemq.ra.MessageEndpointProxy.release(MessageEndpointProxy.java: 
> 67)
> 	at
> org 
> .apache.activemq.ra.ServerSessionImpl.close(ServerSessionImpl.java: 
> 250)
> 	at
> org 
> .apache 
> .activemq 
> .ra.ServerSessionPoolImpl.removeFromPool(ServerSessionPoolImpl.java: 
> 181)
> 	at  
> org.apache.activemq.ra.ServerSessionImpl.run(ServerSessionImpl.java: 
> 176)
> 	at org.jboss.resource.work.WorkWrapper.execute(WorkWrapper.java:204)
> 	at
> org.jboss.util.threadpool.BasicTaskWrapper.run(BasicTaskWrapper.java: 
> 275)
> 	at
> EDU.oswego.cs.dl.util.concurrent.PooledExecutor 
> $Worker.run(PooledExecutor.java:743)
> 	at java.lang.Thread.run(Thread.java:595)
> Caused by: org.apache.activemq.ConnectionClosedException: The  
> connection is
> already closed
> 	at
> org 
> .apache 
> .activemq.ActiveMQConnection.checkClosed(ActiveMQConnection.java:1244)
> 	at
> org 
> .apache 
> .activemq 
> .ActiveMQConnection.checkClosedOrFailed(ActiveMQConnection.java:1231)
> 	at
> org 
> .apache.activemq.TransactionContext.rollback(TransactionContext.java: 
> 407)
> 	... 23 more
>
> Hence my questions:
> - Is it correct to integrate Active MQ with MDB deployed in JBoss by  
> using
> this container configuration "Standard Message Inflow Driven Bean" and
> specify Active MQ RA name? I have tried alternative method where  
> JBoss MQ is
> replaced by Active MQ according to JBoss configuration guide.  
> However I
> cannot get this working because Active MQ does not implement
> Connection.getConnectionConsumer() called by JBoss MDB container.
> - What needs to be configured in JBoss AS and Active MQ so that MDB
> Container continues to consume messages after an exception in MDB?
>
> Thanks in advance for your help,
> Samuel
> -- 
> View this message in context: http://www.nabble.com/Messages-delivery-to-JBoss-MDB-stopped-after-an-exception-tp16741417s2354p16741417.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>


According to JMS specfication v1.1, section 4.5.2 "Asynchronous  
Delivery", an application throws a RuntimeException from within a  
message listener is considered as a programming error.  The following  
is quoted from section 4.5.2:

"It is possible for a listener to throw a RuntimeException; however,  
this is
considered a client programming error. Well-behaved listeners should  
catch
such exceptions and attempt to divert messages causing them to some  
form of
application-specific  unprocessable message  destination.

cheers,

Rob

http://open.iona.com/ -Enterprise Open Integration
http://rajdavies.blogspot.com/




Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message