activemq-dev mailing list archives

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

    [ https://issues.apache.org/activemq/browse/AMQ-2670?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=58561#action_58561
] 

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 https://jira.jboss.org/jira/browse/JBMESSAGING-1608

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 https://jira.jboss.org/jira/browse/JBJCA-39.

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

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"/>
        <!--
                        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
                        -->
       <!-- recovery for ActiveMQ XA pending automated RAR recovery https://jira.jboss.org/jira/browse/JBJCA-39
-->
       <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"
          name="activemq:service=JMSProviderLoader,name=ActiveMQRAR">
      <attribute name="ProviderName">ActiveMQRAR</attribute>
      <attribute name="ProviderAdapterClass">org.jboss.jms.jndi.JNDIProviderAdapter</attribute>
      <attribute name="Properties">xa=true
       java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory
       java.naming.provider.url=tcp://localhost:61616
</attribute>
      <attribute name="QueueFactoryRef">ConnectionFactory</attribute>
      <attribute name="TopicFactoryRef">ConnectionFactory</attribute>
      <attribute name="FactoryRef">ConnectionFactory</attribute>
   </mbean>{code}

This depends on https://issues.apache.org/activemq/browse/AMQ-2656 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: https://issues.apache.org/activemq/browse/AMQ-2670
>             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: ActiveMQXAManagedConnectionFactory.java, 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.


Mime
View raw message