activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gary Tully (JIRA)" <>
Subject [jira] Commented: (AMQ-2670) ClassCast Exception in JBoss when using XA
Date Tue, 30 Mar 2010 13:55:08 GMT


Gary Tully commented on AMQ-2670:

Using JMS apis for out of band recovery will work, there is one relevant jboss fix .w.r.t
restarted the broker service that may also help

Background: The RAR should not create or use an XA connection factory, XA interaction is managed
by the RAR implementation in response to calls from the appserver in accordance with the JCA
transaction contract.
The appserver should also negotiate with the RAR to facilitate recovery using the JCA spi
and that is what will be addressed by

In the mean time, using the JMS api to deal with recovery is a necessary and a reasonable

Recovery is configured in the transaction manager properties using a resource wrapper from
jboss messaging. In jboss 5.0.1_GA, the relevant addition to the transaction manager properties
file: *conf/jbossjta-properties.xml* is:
{code}    <properties depends="arjuna" name="jta">
        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"/>
        <property name="com.arjuna.ats.jta.jtaUTImplementation" value="com.arjuna.ats.internal.jta.transaction.arjunacore.UserTransactionImple"/>
       <!-- recovery for ActiveMQ XA pending automated RAR recovery
       <property name="com.arjuna.ats.jta.recovery.XAResourceRecovery.ActiveMQ" value="org.jboss.jms.server.recovery.MessagingXAResourceRecovery;java:/ActiveMQRAR"/>

    </properties>{code} Note this is a modification to the *jta* configuration, _not_
the recovery manager.

The JNDI name referenced needs to be provided by the ActiveMQ RAR *-ds.xml" descriptor using
a JMSProviderLoader. The addition is as follows:{code}   <mbean code="org.jboss.jms.jndi.JMSProviderLoader"
      <attribute name="ProviderName">ActiveMQRAR</attribute>
      <attribute name="ProviderAdapterClass">org.jboss.jms.jndi.JNDIProviderAdapter</attribute>
      <attribute name="Properties">xa=true
      <attribute name="QueueFactoryRef">ConnectionFactory</attribute>
      <attribute name="TopicFactoryRef">ConnectionFactory</attribute>
      <attribute name="FactoryRef">ConnectionFactory</attribute>

This depends on to allow the ActiveMQ initial
context to return an XA connection factory. Note the property, xa=true in the "Properties"
attribute which ensures that an XAConnectionFactory is created.

> ClassCast Exception in JBoss when using XA 
> -------------------------------------------
>                 Key: AMQ-2670
>                 URL:
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Connector
>    Affects Versions: 5.3.0
>         Environment: activemq-rar-5.3.0.rar deployed in jboss-5.1.0-GA
>            Reporter: Edwin van der Elst
>            Assignee: Gary Tully
>             Fix For: 5.4.0
>         Attachments:, ra.xml
> When deploying the rar under JBoss, the connectionfactory bound in de JNDI tree is always
of type 'ActiveMQConnectionFactory'., while it should be ActiveMQXAConnectionFactory (which
implements XAConnectionFactory).
> I attached a new class that creates the correct type of factory, and this can be configured
in the ra.xml (also attached).

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message