Jboss 4.0/SwiftMQ 5.0

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Jboss 4.0/SwiftMQ 5.0

unni
Hello All,

We are trying to migrate SwiftMQ 5.0 with JBoss 4.0, but we are getting an XATransaction exception. We have a SwiftMQ working version with Jboss 3.1.2. Does anyone have any idea of about any specfic configuration seetings regarding JBoss 4.0

the error looks like this


2006-08-18 17:25:48,947 WARN  [org.jboss.tm.TransactionImpl] XAException: tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=ws050602/11, BranchQual=, localId=11] errorCode=XAER_NOTA
javax.transaction.xa.XAException: No XA transaction has been started or XID is invalid
        at com.swiftmq.jms.v500.XAResourceImpl.end(Unknown Source)


Any help on this would be greatly appretaited.

warm Regards
unni
Reply | Threaded
Open this post in threaded view
|

Re: Jboss 4.0/SwiftMQ 5.0

IIT Software
Administrator
How do you use XA? From an EJB/MDB?
Reply | Threaded
Open this post in threaded view
|

Re: Jboss 4.0/SwiftMQ 5.0

unni
Hello,

First of all let me thank you for the quick response.
We use MDB for inboud messages which in our cases is working fine, and EJB for outbound messages, which is causing the XA Transaction error, if you require further stack trace or any info let me know.

And in JBoss the SwiftMQ is configured in the jms-ds.xml using the swiftmq.rar adapter class.

The configuration /jms/*-ds.xml looks as below

 
 <mbean code="org.jboss.jms.jndi.JMSProviderLoader" name="jboss.mq:service=JMSProviderLoader,name=SwiftMQAdapter">

  <attribute name="ProviderName">DefaultJMSProvider</attribute> 
        <attribute name="ProviderAdapterClass">org.jboss.jms.jndi.JNDIProviderAdapter</attribute>
   
        <attribute name="QueueFactoryRef">QueueConnectionFactory</attribute>
        <attribute name="TopicFactoryRef">QueueConnectionFactory</attribute>
        <attribute name="Properties">
        java.naming.factory.initial=com.swiftmq.jndi.InitialContextFactoryImpl
        java.naming.provider.url=smqp://localhost:4001/timeout=10000
    </attribute>
  </mbean>


<tx-connection-factory>
        <jndi-name>JmsXA</jndi-name>
        <xa-transaction/>

        <rar-name>swiftmq.rar</rar-name>
        <connection-definition>javax.jms.QueueConnectionFactory</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>

regards
unni
Reply | Threaded
Open this post in threaded view
|

Re: Jboss 4.0/SwiftMQ 5.0

IIT Software
Administrator

It seems you're mixing JCA 1.5 and non-JCA stuff in your configuration.

If you're using our JCA 1.5 RA, the configuration for message inflow takes place in your ejb-jar.xml of your MDB(s). Look here.

Outbound configuration requires that you define administered objects (queues/topics) as well as connection factories, connection pools etc pp. This is specific to the app server you use. Commercial app servers like WebLogic or Websphere have nice admin consoles and it is quite easy to define these things during rar deployment (Websphere example here). A more generic explanation with Sun's app server example is here.

We don't have a "How to" yet JBoss 4.x/SwiftMQ 5.x/6.x because we are waiting on this fix. Look here how to define admin objects. I don't know how to define connection factories (out of ManagedConnectionFactories). You'd have to search through the JBoss docs.

What you don't need is this standard JMS provider binding, JMS provider loader stuff etc. That's pre-JCA 1.5 stuff.
Reply | Threaded
Open this post in threaded view
|

Re: Jboss 4.0/SwiftMQ 5.0

unni
Hello,

Thanks a lot for pin pointing the JCA 1.5 and non-JCA stuff configuration. We therefore struck to the "J2ee Connector API 1.0" configuration in JBoss 4.x, and now its works like a charm. Maybe later when we have more time to investigate we would implement the swiftMQ Adapter.
But to fix the XA Transaction error we need to make a minor change in the jms-ds.xml, by setting "track-connection-by-tx=true".

I'm posting the config below, may be it helps someone else too,

  <tx-connection-factory>
    <jndi-name>JmsXA</jndi-name>
    <xa-transaction/>

    <track-connection-by-tx/>

    <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>

Once again thanks a lot for the great support from IIT.

Regards
unni