JBossXAResource res2 = (JBossXAResource)sess2.getXAResource();
MessagingXAResource res2 = (MessagingXAResource)sess2.getXAResource();
   public void testMultipleSessionsOneTxRollbackSend() throws Exception   {      if (ServerManagement.isRemote()) return;            XAConnection conn = null;            Connection conn2 = null;            try      {                  conn = cf.createXAConnection();         conn.start();                     tm.begin();                  //Create 2 sessions and enlist them         XASession sess1 = conn.createXASession();         JBossXAResource res1 = (JBossXAResource)sess1.getXAResource();         XASession sess2 = conn.createXASession();         JBossXAResource res2 = (JBossXAResource)sess2.getXAResource();         res1.setPreventJoining(true);         res2.setPreventJoining(true);                  Transaction tx = tm.getTransaction();         tx.enlistResource(res1);         tx.enlistResource(res2);                  // Send 2 messages - one from each session                  MessageProducer prod1 = sess1.createProducer(queue);         MessageProducer prod2 = sess2.createProducer(queue);                  prod1.send(sess1.createTextMessage("echidna1"));         prod2.send(sess2.createTextMessage("echidna2"));                  //rollback         tx.rollback();                  //Messages should not be in queue                  conn2 = cf.createConnection();         Session sess = conn2.createSession(false, Session.AUTO_ACKNOWLEDGE);         MessageConsumer cons = sess.createConsumer(queue);         conn2.start();                  TextMessage r1 = (TextMessage)cons.receive(1000);         assertNull(r1);               }      finally      {         if (conn != null)         {            conn.close();         }         if (conn2 != null)         {            conn2.close();         }      }         }