0 Replies Latest reply on Oct 5, 2004 12:43 PM by Gerald Quintana

    Sending message from JBoss to Joram

    Gerald Quintana Newbie

      Dear JBoss users,

      I am willing to send JMS messages from an EJB deployed in JBoss to a remote Joram queue. I followed the explanation http://www.jboss.org/wiki/Wiki.jsp?page=HowDoIConfigureTheJMSResourceAdapterToUseARemoteConnectionFactory and I wrote this XML file:

      <?xml version="1.0" encoding="UTF-8"?>
      <connection-factories>
       <mbean code="org.jboss.jms.jndi.JMSProviderLoader"
       name="jboss.mq:service=JMSProviderLoader,name=JoramJMSProvider">
       <attribute name="ProviderName">JoramJMSProvider</attribute>
       <attribute name="ProviderAdapterClass">org.jboss.jms.jndi.JNDIProviderAdapter</attribute>
       <attribute name="QueueFactoryRef">JoramXAQueueConnectionFactory</attribute>
       <attribute name="TopicFactoryRef">JoramXATopicConnectionFactory</attribute>
       <attribute name="Properties">
      java.naming.factory.initial=fr.dyade.aaa.jndi2.client.NamingContextFactory
      java.naming.factory.host=localhost
      java.naming.factory.port=16400
       </attribute>
       </mbean>
       <tx-connection-factory>
       <jndi-name>JoramJmsXA</jndi-name>
       <xa-transaction/>
       <adapter-display-name>JMS Adapter</adapter-display-name>
       <config-property name="SessionDefaultType" type="java.lang.String">javax.jms.Topic</config-property>
       <config-property name="JmsProviderAdapterJNDI" type="java.lang.String">java:/JoramJMSProvider</config-property>
       <max-pool-size>20</max-pool-size>
       <security-domain-and-application>JoramJmsXARealm</security-domain-and-application>
       </tx-connection-factory>
      </connection-factories>
      


      Then, in by EJB, I use the the JoramJmsXA as a XAQueueConnectionFactory and send a message with it. This message arrives properly in Joram, but I get the following error message repeated many times:
      2004-10-05 18:24:54,571 WARN [org.jboss.tm.TransactionImpl] XAException: tx=TransactionImpl:XidImpl [FormatId=257, GlobalId=TRANS-sta-47//603, BranchQual=] errorCode=XA_UNKNOWN(0)
      javax.transaction.xa.XAException: Resource is not enlisted in specified transaction.
       at org.objectweb.joram.client.jms.XAResource.end(XAResource.java:98)
       at org.jboss.tm.TransactionImpl.endResource(TransactionImpl.java:1253)
       at org.jboss.tm.TransactionImpl.endResources(TransactionImpl.java:1331)
       at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:355)
       at org.jboss.tm.TxManager.commit(TxManager.java:142)
       at org.jboss.jms.asf.StdServerSession.onMessage(StdServerSession.java:361)
       at org.jboss.mq.SpyMessageConsumer.sessionConsumerProcessMessage(SpyMessageConsumer.java:871)
       at org.jboss.mq.SpyMessageConsumer.addMessage(SpyMessageConsumer.java:159)
       at org.jboss.mq.SpySession.run(SpySession.java:347)
       at org.jboss.jms.asf.StdServerSession.run0(StdServerSession.java:200)
       at org.jboss.jms.asf.StdServerSession.run(StdServerSession.java:180)
       at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:743)
       at java.lang.Thread.run(Thread.java:534)
      (...)
      2004-10-05 18:24:54,712 ERROR [org.jboss.jms.asf.StdServerSession] failed to commit/rollback
      org.jboss.tm.JBossRollbackException: Unable to commit, tx=TransactionImpl:XidImpl [FormatId=257, GlobalId=TRANS-sta-47//603, BranchQual=] status=STATUS_NO_TRANSACTION; - nested throwable: (javax.transaction.xa.XAException: Resource is not enlisted in specified transaction.)
       at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:415)
       at org.jboss.tm.TxManager.commit(TxManager.java:142)
       at org.jboss.jms.asf.StdServerSession.onMessage(StdServerSession.java:361)
       at org.jboss.mq.SpyMessageConsumer.sessionConsumerProcessMessage(SpyMessageConsumer.java:871)
       at org.jboss.mq.SpyMessageConsumer.addMessage(SpyMessageConsumer.java:159)
       at org.jboss.mq.SpySession.run(SpySession.java:347)
       at org.jboss.jms.asf.StdServerSession.run0(StdServerSession.java:200)
       at org.jboss.jms.asf.StdServerSession.run(StdServerSession.java:180)
       at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:743)
       at java.lang.Thread.run(Thread.java:534)
      Caused by: javax.transaction.xa.XAException: Resource is not enlisted in specified transaction.
       at org.objectweb.joram.client.jms.XAResource.end(XAResource.java:98)
       at org.jboss.tm.TransactionImpl.endResource(TransactionImpl.java:1253)
       at org.jboss.tm.TransactionImpl.endResources(TransactionImpl.java:1331)
       at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:355)
       ... 9 more
      


      Could you tell what's wrong?
      Thanks for your help,
      Gerald