2 Replies Latest reply on Sep 8, 2010 9:54 AM by seb fou

    Problem with JMS XA client sending msg to a remote server

    John Deviney Newbie

      Environment:

      Server1 (jms client)
      Jboss 4.2.2
      Jboss Messaging 1.4.0 SP3

      Server2 (jms server)
      Jboss 4.2.2
      Jboss Messaging 1.4.0 SP3
      Jboss ESB 4.5

      Problem:

      Can't successfully send a JMS message from Server1 to Server2 as part of an XA transaction.

      Client:

      EJB 2.0 (CMT) sending JMS message to queue hosted on Server2. Right now, there is no JDBC XA resource participating in this transaction. Optionally forcing an exception to simulate a rollback condition.

      EJB invoked code:

       public void sendCreateUpdateMessageToEsb(Agency agency)
       {
       EsbManager esbManager = new EsbManager();
      esbManager.sendMessageToEsb(TbotEsbMessageType.AGENCY_CREATED_UPDATED, newAgency);
       // throw new DeploymentException("Forcing an exception");
       }
      


      JMS client code:
       public void sendMessageToEsb(TbotEsbMessageType messageType, Object... objects)
       {
       if (!env.getEsbEnabled())
       {
       log.info("ESB not enabled in configuration. No message sent.");
       return;
       }
       MessageProducer qSender = null;
       TextMessage tm = null;
       try
       {
       String qName = env.getEsbOutboundQName();
       setupJMSConnection(qName);
       qSender = qSession.createProducer(q);
       ESBMessage esbMessage = new ESBMessage();
       esbMessage.setObjects(objects);
       esbMessage.setMessageType(messageType);
       tm = qSession.createTextMessage(XmlUtil.convertVOtoXMLString(esbMessage));
       qSender.send(tm);
       log.info("Message sent: "+ tm.getText());
       }
       catch (Exception ex)
       {
       log.error("Error occured while sending " + messageType + " message.", ex);
       throw new SystemLinkedException(ex);
       }
       finally
       {
       cleanupJMSConnection();
       }
       }
      
       private void setupJMSConnection(String queueName) throws JMSException, NamingException
       {
       Properties envProperties = new Properties();
       envProperties.put(Context.INITIAL_CONTEXT_FACTORY, env.getNamingFactory());
       envProperties.put(Context.URL_PKG_PREFIXES, env.getNamingFactoryPackage());
       envProperties.put(Context.PROVIDER_URL, env.getEsbHostUrl());
       InitialContext initialContxt = new InitialContext(envProperties);
       QueueConnectionFactory qConncectionFactory = (QueueConnectionFactory)initialContxt.lookup("java:/JmsXA");
       qConnection = (QueueConnection)qConncectionFactory.createConnection();
       q = (Queue)initialContxt.lookup(queueName);
       qSession = (QueueSession)qConnection.createSession(true, QueueSession.AUTO_ACKNOWLEDGE);
       qConnection.start();
      
       boolean isTransacted = qSession.getTransacted();
       String isTrx = Boolean.toString(isTransacted);
       log.info("Setting up JMS connection:");
       log.info("INITIAL_CONTEXT_FACTORY: " + env.getNamingFactory());
       log.info("URL_PKG_PREFIXES: " + env.getNamingFactoryPackage());
       log.info("PROVIDER_URL: " + env.getEsbHostUrl());
       log.info("Queue JNDI name: " + queueName);
       log.info("ConnectionFactory JNDI name: " + "java:/JmsXA");
       log.info("Is transaction true: " + isTrx);
       }
      


      Client container log after sending message without a forced rollback:

      [INFO]@[04 Nov 2009 10:11:52,267] [org.twia.esb.EsbManager] : Setting up JMS connection:
      [INFO]@[04 Nov 2009 10:11:52,267] [org.twia.esb.EsbManager] : INITIAL_CONTEXT_FACTORY: org.jnp.interfaces.NamingContextFactory
      [INFO]@[04 Nov 2009 10:11:52,267] [org.twia.esb.EsbManager] : URL_PKG_PREFIXES: org.jboss.naming:org.jnp.interfaces
      [INFO]@[04 Nov 2009 10:11:52,267] [org.twia.esb.EsbManager] : PROVIDER_URL: jnp://172.16.2.203:1099
      [INFO]@[04 Nov 2009 10:11:52,267] [org.twia.esb.EsbManager] : Queue JNDI name: queue/TbotJmsGateway
      [INFO]@[04 Nov 2009 10:11:52,267] [org.twia.esb.EsbManager] : ConnectionFactory JNDI name: java:/JmsXA
      [INFO]@[04 Nov 2009 10:11:52,267] [org.twia.esb.EsbManager] : Is transaction true: true
      [INFO]@[04 Nov 2009 10:11:53,267] [org.twia.esb.EsbManager] : Message sent: <twia:message schemaName="AgencyCreatedUpdatedIn.xsd" xmlns:twia="http://org.twia.titas/message"><agency><locations/></agency><entryTimestamp>2009-11-04T10:11:52.470-06:00</entryTimestamp><messageType>AGENCY_CREATED_UPDATED</messageType></twia:message>
      [ERROR]@[04 Nov 2009 10:11:53,282] [org.jboss.messaging.util.ExceptionUtil] : ConnectionEndpoint[q5-7dzdam1g-1-o618am1g-cw8b9i-t52gs4] sendTransaction [u5-e50eam1g-1-o618am1g-cw8b9i-t52gs4]
      javax.jms.JMSException: Failed to route Reference[2375680]:RELIABLE to TbotJmsGateway
       at org.jboss.jms.server.endpoint.ServerConnectionEndpoint.sendMessage(ServerConnectionEndpoint.java:743)
       at org.jboss.jms.server.endpoint.ServerConnectionEndpoint.processTransaction(ServerConnectionEndpoint.java:792)
       at org.jboss.jms.server.endpoint.ServerConnectionEndpoint.sendTransaction(ServerConnectionEndpoint.java:473)
       at org.jboss.jms.server.endpoint.advised.ConnectionAdvised.org$jboss$jms$server$endpoint$advised$ConnectionAdvised$sendTransaction$aop(ConnectionAdvised.java:101)
       at org.jboss.jms.server.endpoint.advised.ConnectionAdvised$sendTransaction_N3268650789275322226.invokeNext(ConnectionAdvised$sendTransaction_N3268650789275322226.java)
       at org.jboss.jms.server.container.SecurityAspect.handleSendTransaction(SecurityAspect.java:195)
       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.aop.advice.PerInstanceAdvice.invoke(PerInstanceAdvice.java:121)
       at org.jboss.jms.server.endpoint.advised.ConnectionAdvised$sendTransaction_N3268650789275322226.invokeNext(ConnectionAdvised$sendTransaction_N3268650789275322226.java)
       at org.jboss.jms.server.container.ServerLogInterceptor.invoke(ServerLogInterceptor.java:105)
       at org.jboss.jms.server.endpoint.advised.ConnectionAdvised$sendTransaction_N3268650789275322226.invokeNext(ConnectionAdvised$sendTransaction_N3268650789275322226.java)
       at org.jboss.jms.server.endpoint.advised.ConnectionAdvised.sendTransaction(ConnectionAdvised.java)
       at org.jboss.jms.wireformat.ConnectionSendTransactionRequest.serverInvoke(ConnectionSendTransactionRequest.java:82)
       at org.jboss.jms.server.remoting.JMSServerInvocationHandler.invoke(JMSServerInvocationHandler.java:143)
       at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:795)
       at org.jboss.remoting.transport.local.LocalClientInvoker.invoke(LocalClientInvoker.java:101)
       at org.jboss.remoting.Client.invoke(Client.java:1634)
       at org.jboss.remoting.Client.invoke(Client.java:548)
       at org.jboss.remoting.Client.invoke(Client.java:536)
       at org.jboss.jms.client.delegate.DelegateSupport.doInvoke(DelegateSupport.java:189)
       at org.jboss.jms.client.delegate.DelegateSupport.doInvoke(DelegateSupport.java:160)
       at org.jboss.jms.client.delegate.ClientConnectionDelegate.org$jboss$jms$client$delegate$ClientConnectionDelegate$sendTransaction$aop(ClientConnectionDelegate.java:221)
       at org.jboss.jms.client.delegate.ClientConnectionDelegate$sendTransaction_N3268650789275322226.invokeNext(ClientConnectionDelegate$sendTransaction_N3268650789275322226.java)
       at org.jboss.jms.client.container.FailoverValveInterceptor.invoke(FailoverValveInterceptor.java:92)
       at org.jboss.aop.advice.PerInstanceInterceptor.invoke(PerInstanceInterceptor.java:105)
       at org.jboss.jms.client.delegate.ClientConnectionDelegate$sendTransaction_N3268650789275322226.invokeNext(ClientConnectionDelegate$sendTransaction_N3268650789275322226.java)
       at org.jboss.jms.client.container.ClosedInterceptor.invoke(ClosedInterceptor.java:170)
       at org.jboss.aop.advice.PerInstanceInterceptor.invoke(PerInstanceInterceptor.java:105)
       at org.jboss.jms.client.delegate.ClientConnectionDelegate$sendTransaction_N3268650789275322226.invokeNext(ClientConnectionDelegate$sendTransaction_N3268650789275322226.java)
       at org.jboss.jms.client.delegate.ClientConnectionDelegate.sendTransaction(ClientConnectionDelegate.java)
       at org.jboss.jms.tx.ResourceManager.sendTransactionXA(ResourceManager.java:637)
       at org.jboss.jms.tx.ResourceManager.commit(ResourceManager.java:370)
       at org.jboss.jms.tx.MessagingXAResource.commit(MessagingXAResource.java:238)
       at org.jboss.resource.connectionmanager.xa.JcaXAResourceWrapper.commit(JcaXAResourceWrapper.java:53)
       at com.arjuna.ats.internal.jta.resources.arjunacore.XAResourceRecord.topLevelOnePhaseCommit(XAResourceRecord.java:636)
       at com.arjuna.ats.arjuna.coordinator.BasicAction.onePhaseCommit(BasicAction.java:2619)
       at com.arjuna.ats.arjuna.coordinator.BasicAction.End(BasicAction.java:1779)
       at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:88)
       at com.arjuna.ats.arjuna.AtomicAction.end(AtomicAction.java:216)
       at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commit(TransactionImple.java:240)
       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.twia.security.SecurityInterceptor.invoke(SecurityInterceptor.java:105)
       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.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.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:70)
       at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:112)
       at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:100)
       at $Proxy85.updateAgentAndEftAccess(Unknown Source)
       at org.twia.action.AgencyRepAction.performSave(AgencyRepAction.java:246)
       at org.twia.action.CrudAction.performAction(CrudAction.java:83)
       at org.twia.action.BaseAction.execute(BaseAction.java:58)
       at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)
       at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
       at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
       at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.twia.security.AgentSessionFilter.doFilter(AgentSessionFilter.java:101)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
       at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:524)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
       at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
       at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
       at java.lang.Thread.run(Thread.java:595)
      [ERROR]@[04 Nov 2009 10:11:53,282] [org.jboss.ejb.plugins.LogInterceptor] : TransactionRolledbackException in method: public abstract org.twia.agent.Agent org.twia.agent.AgencyManagerSession.updateAgentAndEftAccess(org.twia.agent.Agent,java.lang.String,boolean) throws org.twia.security.SecurityException,org.twia.util.NotFoundException,org.twia.util.AlreadyExistsException,org.twia.util.StaleDataException,java.rmi.RemoteException, causedBy:
      javax.transaction.RollbackException: [com.arjuna.ats.internal.jta.transaction.arjunacore.commitwhenaborted] [com.arjuna.ats.internal.jta.transaction.arjunacore.commitwhenaborted] Can't commit because the transaction is in aborted state
       at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commit(TransactionImple.java:255)
       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.twia.security.SecurityInterceptor.invoke(SecurityInterceptor.java:105)
       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.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.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:70)
       at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:112)
       at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:100)
       at $Proxy85.updateAgentAndEftAccess(Unknown Source)
       at org.twia.action.AgencyRepAction.performSave(AgencyRepAction.java:246)
       at org.twia.action.CrudAction.performAction(CrudAction.java:83)
       at org.twia.action.BaseAction.execute(BaseAction.java:58)
       at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)
       at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
       at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
       at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.twia.security.AgentSessionFilter.doFilter(AgentSessionFilter.java:101)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
       at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:524)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
       at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
       at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
       at java.lang.Thread.run(Thread.java:595)
      [ERROR]@[04 Nov 2009 10:11:53,298] [org.twia.DebugExceptionHandler] : Unhandled Exception:
       Throwable details - org.jboss.tm.JBossTransactionRolledbackException: null; nested exception is:
       javax.transaction.RollbackException: [com.arjuna.ats.internal.jta.transaction.arjunacore.commitwhenaborted] [com.arjuna.ats.internal.jta.transaction.arjunacore.commitwhenaborted] Can't commit because the transaction is in aborted state; - nested throwable: (javax.transaction.RollbackException: [com.arjuna.ats.internal.jta.transaction.arjunacore.commitwhenaborted] [com.arjuna.ats.internal.jta.transaction.arjunacore.commitwhenaborted] Can't commit because the transaction is in aborted state)
       at org.jboss.ejb.plugins.TxInterceptorCMT.throwJBossException(TxInterceptorCMT.java:574)
       at org.jboss.ejb.plugins.TxInterceptorCMT.endTransaction(TxInterceptorCMT.java:506)
       at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:361)
       at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)
       at org.twia.security.SecurityInterceptor.invoke(SecurityInterceptor.java:105)
       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.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.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:70)
       at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:112)
       at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:100)
       at $Proxy85.updateAgentAndEftAccess(Unknown Source)
       at org.twia.action.AgencyRepAction.performSave(AgencyRepAction.java:246)
       at org.twia.action.CrudAction.performAction(CrudAction.java:83)
       at org.twia.action.BaseAction.execute(BaseAction.java:58)
       at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)
       at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
       at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
       at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.twia.security.AgentSessionFilter.doFilter(AgentSessionFilter.java:101)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
       at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:524)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
       at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
       at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
       at java.lang.Thread.run(Thread.java:595)
      Caused by: javax.transaction.RollbackException: [com.arjuna.ats.internal.jta.transaction.arjunacore.commitwhenaborted] [com.arjuna.ats.internal.jta.transaction.arjunacore.commitwhenaborted] Can't commit because the transaction is in aborted state
       at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commit(TransactionImple.java:255)
       at org.jboss.ejb.plugins.TxInterceptorCMT.endTransaction(TxInterceptorCMT.java:501)
       ... 56 more
      
      


      Server2 container JMS config files to enable XA follow.

      jbossjta-properties.xml:
      <?xml version="1.0" encoding="UTF-8"?>
      <transaction-service>
       <properties depends="common" name="arjuna">
       <!--
       Transaction Reaper Timeout (default is 120000 ms).
       -->
       <property
       name="com.arjuna.ats.arjuna.coordinator.txReaperTimeout" value="120000"/>
       <!--
       Transaction Reaper Mode, can be: NORMAL or DYNAMIC (default is NORMAL).
       -->
       <property name="com.arjuna.ats.arjuna.coordinator.txReaperMode" value="DYNAMIC"/>
       <!--
       (default is NO)
       -->
       <property name="com.arjuna.ats.arjuna.coordinator.asyncCommit" value="NO"/>
       <!--
       (default is NO)
       -->
       <property name="com.arjuna.ats.arjuna.coordinator.asyncPrepare" value="NO"/>
       <!--
       (default is YES)
       -->
       <property
       name="com.arjuna.ats.arjuna.coordinator.commitOnePhase" value="YES"/>
       <!--
       (default is defaultStore)
       -->
       <property name="com.arjuna.ats.arjuna.objectstore.localOSRoot" value="defaultStore"/>
       <!--
       default is under user.home - must be writeable!)
       -->
       <property
       name="com.arjuna.ats.arjuna.objectstore.objectStoreDir" value="PutObjectStoreDirHere"/>
       <!--
       (default is ON)
       -->
       <property
       name="com.arjuna.ats.arjuna.objectstore.objectStoreSync" value="ON"/>
       <!--
       (default is ShadowNoFileLockStore)
       -->
       <property
       name="com.arjuna.ats.arjuna.objectstore.objectStoreType" value="ShadowNoFileLockStore"/>
       <!--
       (default is 255)
       -->
       <property
       name="com.arjuna.ats.arjuna.objectstore.hashedDirectories" value="255"/>
       <!--
       (default is ON)
       -->
       <property
       name="com.arjuna.ats.arjuna.objectstore.transactionSync" value="ON"/>
       <!--
       (Must be unique across all Arjuna instances.)
       -->
       <property name="com.arjuna.ats.arjuna.xa.nodeIdentifier" value="1"/>
       <!-- property
       name="com.arjuna.ats.arjuna.coordinator.actionStore"
       value="HashedActionStore"
       value="JDBCActionStore"
       -->
       <!-- property
       name="com.arjuna.ats.arjuna.objectstore.jdbcTxDbAccess"
       value="JDBCAccess"
       -->
       <!-- property
       name="com.arjuna.ats.arjuna.objectstore.objectStoreType"
       value="ShadowNoFileLockStore"
       value="JDBCStore"
       -->
       <!-- property
       name="com.arjuna.ats.arjuna.objectstore.jdbcUserDbAccess"
       value="JDBCAccess"
       -->
       <!-- property
       name="com.arjuna.ats.arjuna.objectstore.jdbcPoolSizeInitial"
       value="1"
       -->
       <!-- property
       name="com.arjuna.ats.arjuna.objectstore.jdbcPoolSizeMaximum"
       value="1"
       -->
       <!-- property
       name="com.arjuna.ats.arjuna.objectstore.jdbcPoolPutConnections"
       value="false"
       -->
       <!-- property
       name="com.arjuna.ats.arjuna.internal.arjuna.objectstore.cacheStore.size"
       value=""
       -->
       <!-- property
       name="com.arjuna.ats.arjuna.internal.arjuna.objectstore.cacheStore.period"
       value=""
       -->
       <!--
       The location for creating temporary files, e.g., Uids.
       Default is under user.home.
       IMPORTANT: make sure the directory is lockable, e.g., /tmp on Unix
       may not be!
       -->
       <!--
       <property
       name="com.arjuna.ats.arjuna.common.varDir"
       value="var"/>
       -->
       </properties>
       <properties name="common">
       <!-- CLF 2.0 properties -->
       <property name="com.arjuna.common.util.logging.DebugLevel"
       type="System" value="0x00000000"/>
       <property name="com.arjuna.common.util.logging.FacilityLevel"
       type="System" value="0xffffffff"/>
       <property name="com.arjuna.common.util.logging.VisibilityLevel"
       type="System" value="0xffffffff"/>
       <property name="com.arjuna.common.util.logger" type="System" value="log4j"/>
       </properties>
       <properties depends="arjuna" name="txoj">
       <!--
       (default is LockStore of installation - must be writeable!)
       -->
       <!--
       <property
       name="com.arjuna.ats.txoj.lockstore.lockStoreDir"
       value="LockStore"/>
       -->
       <!--
       (default is BasicLockStore)
       -->
       <property name="com.arjuna.ats.txoj.lockstore.lockStoreType" value="BasicLockStore"/>
       <!--
       (default is NO)
       -->
       <property name="com.arjuna.ats.txoj.lockstore.multipleLockStore" value="NO"/>
       <!--
       (default is YES)
       -->
       <property name="com.arjuna.ats.txoj.lockstore.singleLockStore" value="YES"/>
       <!--
       (default is YES)
       -->
       <property
       name="com.arjuna.ats.txoj.lockstore.allowNestedLocking" value="YES"/>
       </properties>
       <properties depends="arjuna" name="jta">
       <!-- bug 5429 -->
       <property name="com.arjuna.ats.jta.allowMultipleLastResources" value="true"/>
       <!-- bug 5429 -->
       <!--
       Support subtransactions in the JTA layer?
       Default is NO.
       -->
       <property name="com.arjuna.ats.jta.supportSubtransactions" value="NO"/>
       <property name="com.arjuna.ats.jta.jtaTMImplementation" value="com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionManagerImple"/>
       <!--
       com.arjuna.ats.internal.jta.transaction.jts.TransactionManagerImple
       -->
       <property name="com.arjuna.ats.jta.jtaUTImplementation" value="com.arjuna.ats.internal.jta.transaction.arjunacore.UserTransactionImple"/>
       <!--
       com.arjuna.ats.internal.jta.transaction.jts.UserTransactionImple
       -->
       <!--
       *** Add this line to enable recovery for JMS resources using DefaultJMSProvider ***
       -->
       <property name="com.arjuna.ats.jta.recovery.XAResourceRecovery.JBMESSAGING1"
       value="org.jboss.jms.server.recovery.MessagingXAResourceRecovery;java:/DefaultJMSProvider"/>
      
       </properties>
       <properties depends="arjuna,txoj,jta" name="recoverymanager">
       <!--
       Properties used only by the RecoveryManager.
       -->
       <!--
       Periodic recovery settings.
       Time values in this section are in seconds.
       -->
       <!--
       Interval in seconds between initiating the periodic recovery modules.
       Default is 120 seconds.
       -->
       <property
       name="com.arjuna.ats.arjuna.recovery.periodicRecoveryPeriod" value="120"/>
       <!--
       Interval in seconds between first and second pass of periodic recovery.
       Default is 10 seconds.
       -->
       <property
       name="com.arjuna.ats.arjuna.recovery.recoveryBackoffPeriod" value="10"/>
       <!--
       Periodic recovery modules to use. Invoked in sort-order of names.
       -->
       <property
       name="com.arjuna.ats.arjuna.recovery.recoveryExtension1" value="com.arjuna.ats.internal.arjuna.recovery.AtomicActionRecoveryModule"/>
       <property
       name="com.arjuna.ats.arjuna.recovery.recoveryExtension2" value="com.arjuna.ats.internal.txoj.recovery.TORecoveryModule"/>
       <property
       name="com.arjuna.ats.arjuna.recovery.recoveryExtension3" value="com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule"/>
       <!--
       Expired entry removal
       -->
       <!--
       Expiry scanners to use (order of invocation is random).
       Names must begin with "com.arjuna.ats.arjuna.recovery.expiryScanner"
       -->
       <property
       name="com.arjuna.ats.arjuna.recovery.expiryScannerTransactionStatusManager" value="com.arjuna.ats.internal.arjuna.recovery.ExpiredTransactionStatusManagerScanner"/>
       <!--
       Interval, in hours, between running the expiry scanners.
       This can be quite long. The absolute value determines the interval -
       if the value is negative, the scan will NOT be run until after one
       interval has elapsed. If positive the first scan will be immediately
       after startup. Zero will prevent any scanning.
       Default = 12 = run immediately, then every 12 hours.
       -->
       <property
       name="com.arjuna.ats.arjuna.recovery.expiryScanInterval" value="12"/>
       <!--
       Age, in hours, for removal of transaction status manager item.
       This should be longer than any ts-using process will remain running.
       Zero = Never removed. Default is 12.
       -->
       <property
       name="com.arjuna.ats.arjuna.recovery.transactionStatusManagerExpiryTime" value="12"/>
       <!--
       Use this to fix the port on which the TransactionStatusManager listens,
       The default behaviour is to use any free port.
       -->
       <property
       name="com.arjuna.ats.arjuna.recovery.transactionStatusManagerPort" value="0"/>
       </properties>
       <properties depends="jta" name="jdbc">
       <!--
       property name="com.arjuna.ats.jdbc.isolationLevel" value="TRANSACTION_SERIALIZABLE"/>
       -->
       </properties>
      </transaction-service>
      
      


      jms-ds.xml:
      <?xml version="1.0" encoding="UTF-8"?>
      
      <connection-factories>
      
       <!-- ==================================================================== -->
       <!-- JMS Stuff -->
       <!-- ==================================================================== -->
      
       <!-- The JMS provider loader -->
       <mbean code="org.jboss.jms.jndi.JMSProviderLoader"
       name="jboss.messaging:service=JMSProviderLoader,name=JMSProvider">
       <attribute name="ProviderName">DefaultJMSProvider</attribute>
       <attribute name="ProviderAdapterClass">
       org.jboss.jms.jndi.JNDIProviderAdapter
       </attribute>
       <!-- The combined connection factory -->
       <attribute name="FactoryRef">java:/XAConnectionFactory</attribute>
       <!-- The queue connection factory -->
       <attribute name="QueueFactoryRef">java:/XAConnectionFactory</attribute>
       <!-- The topic factory -->
       <attribute name="TopicFactoryRef">java:/XAConnectionFactory</attribute>
       <!-- Uncomment to use HAJNDI to access JMS
       <attribute name="Properties">
       java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
       java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
       java.naming.provider.url=localhost:1100
       </attribute>
       -->
       </mbean>
      
       <!-- The server session pool for Message Driven Beans -->
       <mbean code="org.jboss.jms.asf.ServerSessionPoolLoader"
       name="jboss.messaging:service=ServerSessionPoolMBean,name=StdJMSPool">
       <depends optional-attribute-name="XidFactory">jboss:service=XidFactory</depends>
       <attribute name="PoolName">StdJMSPool</attribute>
       <attribute name="PoolFactoryClass">
       org.jboss.jms.asf.StdServerSessionPoolFactory
       </attribute>
       </mbean>
      
       <!-- JMS XA Resource adapter, use this to get transacted JMS in beans -->
       <tx-connection-factory>
       <jndi-name>JmsXA</jndi-name>
       <xa-transaction/>
       <rar-name>jms-ra.rar</rar-name>
       <connection-definition>org.jboss.resource.adapter.jms.JmsConnectionFactory</connection-definition>
       <config-property name="SessionDefaultType" type="java.lang.String">javax.jms.Topic</config-property>
       <config-property name="JmsProviderAdapterJNDI" type="java.lang.String">java:/DefaultJMSProvider</config-property>
       <max-pool-size>20</max-pool-size>
       <security-domain-and-application>JmsXARealm</security-domain-and-application>
       </tx-connection-factory>
      
      </connection-factories>
      
      


      Why do I get the exception in Server1? What am I doing wrong? I've read through all the Jboss Messaging docs I can find and search through the forum.

      Thanks.