[EJB 3.0] - Multiple MDBs, multiple queues
by eidolon1138
I have an MDB that listens to an ActiveMQ queue. It work beautifully. It registers with AMQ and onMessagae fires for each message posted to the queue. I have a business rule that forces me to process all messages in the order they were posted to the queue. To accomplish this, I have set maxMessagesPerSessions=1 and maxSessions=1.
Now I need to expand my application with another MDB listening to a different queue, again, order is important. I have added a new MDB class with annotations that reference the new queue. When I deploy to the server, my beans both connect to their respective queues (I can see this in the AMQ log).
However, when I post a message to either queue I get inconsistent results. Whichever queue I post to FIRST will work, and the corresponding MDB's onMessage fires. At this point, if I post a message to the other queue, the message is not delivered. The onMessage method of the other MDB is never invoked, nor are there any exceptions. The message just sits on the queue. Bouncing my server doesn't help.
In an attempt to learn more, I took out the maxMessagesPerSessions and maxSessions annotations, and the behavior changed, but I'm not sure it is an improvement. Now, both queues seem to work properly **AFTER the first message**. I've turned on every logging option I could find, and what I see in this case is that when the first message is posted to any queue, a ServerSessionImpl is requested from the pool, but it never runs and onMessage is not invoked.
I'm using JBoss 4.2.2 and ActiveMQ 5.1.0. I have AMQ deployed as a stand-alone service. I use annotations in leiu of XML config files, except for the ra.xml, which points to the server at tcp://localhost:61616.
Any suggestions on how to make my MDBs get along?
Thanks,
- Dave
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4180367#4180367
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4180367
17 years, 9 months
[EJB/JBoss] - Are these warnings on startup anything to be concerned with?
by rickcr
I want to make sure I'm doing things the proper way in the setup of this JBoss5 EJB3 application. I'm noticing a few warnings, but googling about them hasn't been too helpful. Just wondering if there is something I should be doing differently to avoid the warnings or maybe they are fine and nothing to worry about? TIA
| 16:21:50,232 WARN [SessionSpecContainer] Populating JBoss-specific annotation metadata manually until done by deployers: jboss.j2ee:ear=user-administration.ear,jar=lt-ejb-jar-1.0-SNAPSHOT.jar,name=UserServiceBean,service=EJB3
| ....
| 16:23:23,086 WARN [LifecycleCallbacks] EJBTHREE-1480: LifecycleCallbackStack has not been defined for domain 'Stateless Bean'
| 16:23:23,098 WARN [InterceptorsFactory] EJBTHREE-1246: Do not use InterceptorsFactory with a ManagedObjectAdvisor, InterceptorRegistry should be used via the bean container
| 16:23:23,100 WARN [InterceptorsFactory] EJBTHREE-1246: Do not use InterceptorsFactory with a ManagedObjectAdvisor, InterceptorRegistry should be used via the bean container
| 16:23:23,102 WARN [InterceptorRegistry] applicable interceptors is non-existent for public java.util.Collection net.learntechnology.service.UserServiceBean.getUsers()
| 16:23:23,106 WARN [InterceptorRegistry] applicable interceptors is non-existent for public java.lang.String net.learntechnology.service.UserServiceBean.helloWorld(java.lang.String)
| ...several more WARNS about InterceptorRegistry like the above for the methods
|
My StatelessSessionBean looks like the following and is working fine:
| @Stateless
| public class UserServiceBean implements UserService {
|
| @PersistenceContext(unitName="OurEntityManager")
| private EntityManager em;
|
| public String helloWorld(String s) {
| return "Hello World: "+s;
| }
|
| public User saveUser(User user) {
| this.em.persist(user);
| this.em.flush();
| return user;
| }
|
| public Collection<User> getUsers() {
| return this.em.createQuery("select user from User user order by user.lastName").getResultList();
| }
|
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4180366#4180366
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4180366
17 years, 9 months
[JBossMQ] - Re: HeuristicMixed Exception (javax.jms.IllegalStateExceptio
by jhowell@redhat.com
Ok, So you were getting errors with the new tx manager that said "WARN Adding multiple last resources is disallowed. Current resource is ". So you moved back to old deprecated tx manager so you could enlist multiple 1phase commit resources. Am I right so far? You may have even changed the settings in arjuna for com.arjuna.ats.jta.allowMultipleLastResources.
The problem is that you have multiple 1phase commit resources. The reason it's called a last resource, is because the 1pc resource should be the last resource being committed, because it can't be rolled back. Remember this is a 1 phase commit object, not a prepare and a commit. If you commit multiple 1pc resources in your tx, then you can only throw an exception out of the last 1pc resource. You can't roll the other 1pc resources back that have already committed. Does that make sense so far. When you try to roll back 1pc resoruces that have already been committed, you get a heuristic exception, which means that all the 2pc resources have been rolled back, but the 1pc resources were not able to. So you have some part of your tx that was committed and some part that wasn't.
So the answer is to change things to use 2PC or to separate your resources into separate transactions. The easiest thing is to change your Datasource to be an XA datasource and don't use other 1PC resources in your transactions.
The issue is not really mq. What is happening is normal. When something happens with mq, it will roll the transaction back. Since some 1pc resoruces have been committed already, it can't rollback and you get a heuristic exception.
I think you have a fairly big anti-pattern also. Your tx is way to long. A 2 hour long running transaction is not a good thing to have. You should find a different way. A 2 hour long running transaction tells me there is a design problem.
Jay:)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4180360#4180360
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4180360
17 years, 9 months
[JBossMQ] - HeuristicMixed Exception (javax.jms.IllegalStateException: T
by pdevireddy
Hello Everyone,
This issue is haunting us. We have recently moved to JBoss 4.2.2 GA from Orion application server.
We have four instances of JBoss Servers on one Linux machine. We are consistently getting the HeuristicMixed Exception. We switched the JBoss JTA to the deprecated in-memory transaction manager to get a more accurate Exception stack trace. In the architecture of our application, the client is a Webstart based Java application. It invokes a Stateless Session Bean which executes a long running transaction. In between, we also send and receive messages to/from ActiveMQ.
During the long running transaction (more than 2 hours), it also may send a JMS message to JBOSS MQ server. "java:/JmsXA" is used to look up the JMS connection. After the message is sent, the jms connection is closed by the java code.
Jboss jta configuration has been modified to allow sub-transactions. And, the datasource used is local-tx-datasource.
We are having this issue in Production for the last few weeks. Any help is greatly appreciated.
Here is the exception:
2008-10-02 06:07:00,215 DEBUG [org.jboss.mq.referenceable.SpyDestinationObjectFactory] SpyDestinationObjectFactory->getObjectInstance()
2008-10-02 06:07:00,216 INFO [com.coslp.riskcenter.server.m2m.M2MDataBO] CompleteM2M for cmdTypeId: 3, systemCode: RC
2008-10-02 06:07:00,220 INFO [com.coslp.riskcenter.server.server.ServerDataBO] RC M2M completed for Power
2008-10-02 06:07:00,220 INFO [com.coslp.riskcenter.server.server.ServerDataBO] M2M completed for Power
2008-10-02 06:07:00,274 WARN [org.jboss.tm.TransactionImpl] XAException: tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=sercprodapp3/166642, BranchQual=, localId=166642] errorCode=XAER_RMFAIL
org.jboss.mq.SpyXAException: Resource manager error during prepare; - nested throwable: (javax.jms.IllegalStateException: The connection is closed)
at org.jboss.mq.SpyXAException.getAsXAException(SpyXAException.java:72)
at org.jboss.mq.SpyXAResource.prepare(SpyXAResource.java:151)
at org.jboss.resource.connectionmanager.xa.JcaXAResourceWrapper.prepare(JcaXAResourceWrapper.java:93)
at org.jboss.tm.TransactionImpl$Resource.prepare(TransactionImpl.java:2212)
at org.jboss.tm.TransactionImpl.prepareResources(TransactionImpl.java:1660)
at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:347)
at org.jboss.ejb.plugins.TxInterceptorCMT.endTransaction(TxInterceptorCMT.java:501)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:361)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:168)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:138)
at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:648)
at org.jboss.ejb.Container.invoke(Container.java:960)
at sun.reflect.GeneratedMethodAccessor110.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
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.unified.server.UnifiedInvoker.invoke(UnifiedInvoker.java:231)
at sun.reflect.GeneratedMethodAccessor117.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
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 javax.management.MBeanServerInvocationHandler.invoke(MBeanServerInvocationHandler.java:288)
at $Proxy15.invoke(Unknown Source)
at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:769)
at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:573)
at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:387)
at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:166)
Caused by: javax.jms.IllegalStateException: The connection is closed
at org.jboss.mq.Connection.checkClosed(Connection.java:1246)
at org.jboss.mq.Connection.send(Connection.java:1106)
at org.jboss.mq.SpyXAResourceManager.prepare(SpyXAResourceManager.java:255)
at org.jboss.mq.SpyXAResource.prepare(SpyXAResource.java:147)
... 35 more
2008-10-02 06:07:11,156 DEBUG [org.jboss.remoting.transport.socket.ServerThread] WorkerThread#1[10.10.3.51:52753] closing socketWrapper: ServerSocketWrapper[Socket[addr=/10.10.3.51,port=52753,localport=1446].47a4a804]
2008-10-02 06:07:11,156 DEBUG [org.jboss.remoting.transport.socket.ServerSocketWrapper] wrote CLOSING
2008-10-02 06:07:11,156 DEBUG [org.jboss.remoting.transport.socket.SocketWrapper] ServerSocketWrapper[Socket[addr=/10.10.3.51,port=52753,localport=1446].47a4a804] closing
2008-10-02 06:09:03,362 WARN [org.jboss.tm.TransactionImpl] XAException: tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=sercprodapp3/166642, BranchQual=, localId=166642] errorCode=XAER_RMFAIL
org.jboss.mq.SpyXAException: Resource manager error during rollback; - nested throwable: (javax.jms.IllegalStateException: The connection is closed)
at org.jboss.mq.SpyXAException.getAsXAException(SpyXAException.java:72)
at org.jboss.mq.SpyXAResource.rollback(SpyXAResource.java:182)
at org.jboss.resource.connectionmanager.xa.JcaXAResourceWrapper.rollback(JcaXAResourceWrapper.java:103)
at org.jboss.tm.TransactionImpl$Resource.rollback(TransactionImpl.java:2277)
at org.jboss.tm.TransactionImpl.rollbackResources(TransactionImpl.java:1837)
at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:368)
at org.jboss.ejb.plugins.TxInterceptorCMT.endTransaction(TxInterceptorCMT.java:501)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:361)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:168)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:138)
at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:648)
at org.jboss.ejb.Container.invoke(Container.java:960)
at sun.reflect.GeneratedMethodAccessor110.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
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.unified.server.UnifiedInvoker.invoke(UnifiedInvoker.java:231)
at sun.reflect.GeneratedMethodAccessor117.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
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 javax.management.MBeanServerInvocationHandler.invoke(MBeanServerInvocationHandler.java:288)
at $Proxy15.invoke(Unknown Source)
at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:769)
at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:573)
at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:387)
at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:166)
Caused by: javax.jms.IllegalStateException: The connection is closed
at org.jboss.mq.Connection.checkClosed(Connection.java:1246)
at org.jboss.mq.Connection.send(Connection.java:1106)
at org.jboss.mq.SpyXAResourceManager.rollback(SpyXAResourceManager.java:308)
at org.jboss.mq.SpyXAResource.rollback(SpyXAResource.java:178)
... 35 more
2008-10-02 06:09:03,368 ERROR [org.jboss.ejb.plugins.LogInterceptor] TransactionRolledbackException in method: public abstract java.lang.Object com.coslp.riskcenter.framework.PCIAutomaticEJBObject.executeTransactional(com.coslp.riskcenter.framework.PCExecutionMetadata,java.lang.String,java.lang.String,java.lang.Object[]) throws java.rmi.RemoteException,com.coslp.riskcenter.framework.PCAppException, causedBy:
org.jboss.tm.JBossRollbackException: Unable to commit, tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=sercprodapp3/166642, BranchQual=, localId=166642] status=STATUS_NO_TRANSACTION; - nested throwable: (org.jboss.mq.SpyXAException: Resource manager error during prepare; - nested throwable: (javax.jms.IllegalStateException: The connection is closed))
at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:372)
at org.jboss.ejb.plugins.TxInterceptorCMT.endTransaction(TxInterceptorCMT.java:501)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:361)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:168)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:138)
at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:648)
at org.jboss.ejb.Container.invoke(Container.java:960)
at sun.reflect.GeneratedMethodAccessor110.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
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.unified.server.UnifiedInvoker.invoke(UnifiedInvoker.java:231)
at sun.reflect.GeneratedMethodAccessor117.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
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 javax.management.MBeanServerInvocationHandler.invoke(MBeanServerInvocationHandler.java:288)
at $Proxy15.invoke(Unknown Source)
at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:769)
at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:573)
at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:387)
at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:166)
Caused by: org.jboss.mq.SpyXAException: Resource manager error during prepare; - nested throwable: (javax.jms.IllegalStateException: The connection is closed)
at org.jboss.mq.SpyXAException.getAsXAException(SpyXAException.java:72)
at org.jboss.mq.SpyXAResource.prepare(SpyXAResource.java:151)
at org.jboss.resource.connectionmanager.xa.JcaXAResourceWrapper.prepare(JcaXAResourceWrapper.java:93)
at org.jboss.tm.TransactionImpl$Resource.prepare(TransactionImpl.java:2212)
at org.jboss.tm.TransactionImpl.prepareResources(TransactionImpl.java:1660)
at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:347)
... 31 more
Caused by: javax.jms.IllegalStateException: The connection is closed
at org.jboss.mq.Connection.checkClosed(Connection.java:1246)
at org.jboss.mq.Connection.send(Connection.java:1106)
at org.jboss.mq.SpyXAResourceManager.prepare(SpyXAResourceManager.java:255)
at org.jboss.mq.SpyXAResource.prepare(SpyXAResource.java:147)
... 35 more
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4180359#4180359
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4180359
17 years, 9 months
[Installation, Configuration & DEPLOYMENT] - Re: Log to syslog
by PeterJ
According to the javadoc:
anonymous wrote : The facilityName parameter must be one of the
| strings KERN, USER, MAIL, DAEMON, AUTH, SYSLOG, LPR, NEWS, UUCP,
| CRON, AUTHPRIV, FTP, LOCAL0, LOCAL1, LOCAL2, LOCAL3, LOCAL4,
| LOCAL5, LOCAL6, LOCAL7. Case is unimportant.
And it does look like the setFacility() code checks for the name.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4180356#4180356
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4180356
17 years, 9 months