0 Replies Latest reply on Jul 20, 2006 11:17 AM by Brian Viveiros

    Multiple JBoss Servers, One JMS Queue

    Brian Viveiros Newbie

      Sorry, I combed through the forums and seen similar posts but couldn't find a posted solution.

      Is it possible to have 2 JBoss Servers Posting and Receiving messages to/from the same JMS queue?

      In my setup I have 2 JBoss servers being load balanced, but not clustered.
      The intention of the design is so that if one JBoss AS fails, the second server is still connected to the queue.

      JBoss 4.0.3SP1
      MySql 5 for message persistance.
      MySql is replicating to a slave database.


      Here's the stack track:

      2006-07-19 16:33:12,424 WARN (Thread: http-0.0.0.0-8080-3) [jboss.tm.TransactionImpl] XAException: tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=IMP1-LAB.MTI.local/197, BranchQual=, localId=197] errorCode=XAER_RMERR
      org.jboss.mq.SpyXAException: - nested throwable: (org.jboss.mq.SpyTransactionRolledBackException: Transaction was rolled back.; - nested throwable: (org.jboss.mq.SpyJMSException: Could not store message: 3346 msg=16 hard NOT_STORED PERSISTENT queue=QUEUE.impInbox priority=10 lateClone=false hashCode=21561092; - nested throwable: (java.sql.SQLException: Duplicate entry '16-QUEUE.impInbox' for key 1)))
       at org.jboss.mq.SpyXAResource.prepare(SpyXAResource.java:134)
       at org.jboss.tm.TransactionImpl$Resource.prepare(TransactionImpl.java:2192)
       at org.jboss.tm.TransactionImpl.prepareResources(TransactionImpl.java:1642)
       at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:329)
       at org.jboss.tm.TxManager.commit(TxManager.java:224)
       at org.jboss.tm.usertx.client.ServerVMClientUserTransaction.commit(ServerVMClientUserTransaction.java:126)
       at com.mythum.imp.web.SMSReceiveServlet.doPost(SMSReceiveServlet.java:214)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
       at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:159)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
       at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
       at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
       at java.lang.Thread.run(Thread.java:595)
      Caused by: org.jboss.mq.SpyTransactionRolledBackException: Transaction was rolled back.; - nested throwable: (org.jboss.mq.SpyJMSException: Could not store message: 3346 msg=16 hard NOT_STORED PERSISTENT queue=QUEUE.impInbox priority=10 lateClone=false hashCode=21561092; - nested throwable: (java.sql.SQLException: Duplicate entry '16-QUEUE.impInbox' for key 1))
       at org.jboss.mq.server.JMSDestinationManager.transact(JMSDestinationManager.java:473)
       at org.jboss.mq.server.JMSServerInvoker.transact(JMSServerInvoker.java:186)
       at org.jboss.mq.il.jvm.JVMServerIL.transact(JVMServerIL.java:327)
       at org.jboss.mq.Connection.send(Connection.java:1163)
       at org.jboss.mq.SpyXAResourceManager.prepare(SpyXAResourceManager.java:207)
       at org.jboss.mq.SpyXAResource.prepare(SpyXAResource.java:130)
       ... 27 more