8 Replies Latest reply: Jun 14, 2012 7:24 PM by Stan Brown RSS

XAResourceRecovery Configuration in AS7

Stan Brown Newbie

Hi,

 

I need to know where to place the jar containing the JBossTS XAResourceRecovery implementation in AS7.  I've added the com.arjuna.ats.jta.recovery.XAResourceRecoverySomeName property under the <system-properties> element in domain.xml, but this led to a classloader issue (class not found) in ModuleClassLoader (Warning ARJUNA012216).  So I tried creating a JBoss module containing my implementation, but I got the same results. 

 

Is there any documentation someone can point me at regarding XA transaction recovery configuration in AS7?  Or is XAResourceRecovery not needed any more when running JBossTS in AS7.   Or do I use the recovery element in ironjacamar.xml (or under the resource-adapters subsystem) to configure XA recovery?

 

Also, should I use the JTAEnvironmentBean.xaResourceRecoveryInstances property instead of the com.arjuna.ats.jta.recovery.XAResourceRecovery property.

 

Thanks.

  • 1. Re: XAResourceRecovery Configuration in AS7
    Tom Jenkinson Master

    Hi Stan,

     

    Please can you provide a little context behind this? If you are using something that can be added as a "xa-datasource" in the AS7 configuration file then you shouldn't really need to add it as IronJacamar should take care of it for you.

     

    Tom

  • 2. Re: XAResourceRecovery Configuration in AS7
    Stan Brown Newbie

    Sorry for the late reply. We have a standard resource adapter that communicates with our EIS.  I'm trying to configure our XAResourceRecovery implementation in AS7.  In one of our XA recovery test that uses two resources, the transaction is forced to fail during the commit phase of the first resource.  During the transaction branch recovery, the recovery manager is not able to find our XAResourceRecovery implementation and logs the following message:

     

    [code]

    ARJUNA016037: Could not find new XAResource to use for recovering non-serializable XAResource XAResourceRecord

    [/code]

     

    I've configured the XAResourceRecovery implementation as follows:

     

    [code]

        <system-properties>

          <property

              name="com.arjuna.ats.jta.recovery.XAResourceRecoveryJRAC"

              value="com.unisys.tip.TIPXAResourceRecovery"/>

        </system-properties>

    [/code]

     

     

     

    But this simply leads to the following warning being logged:

     

    [code]

    12:53:40,085 WARN  [com.arjuna.ats.arjuna] (MSC service thread 1-5) ARJUNA012216: attempt to load com.unisys.tip.TIPXAResourceRecovery threw ClassNotFound. Wrong classloader?: java.lang.ClassNotFoundException: com.unisys.tip.TIPXAResourceRecovery.

    [/code]

     

     

    I've configured the resource adapter using the ironjacamar.xml deployment descriptor in both standalone and domain modes; I've also tried the resource-adapter configuration, but only in standalone mode.

     

     

    Here's the ironjacamar configuration

     

    [code]

    <ironjacamar>

      <transaction-support>XATransaction</transaction-support>

      <connection-definitions>

        <connection-definition

            jndi-name="java:jboss/env/eis/rb/resource"

            class-name="com.unisys.coms.connector.COMSManagedConnectionFactory">

          <pool>

            <min-pool-size>2</min-pool-size>

            <max-pool-size>20</max-pool-size>

          </pool>

        </connection-definition>

        <connection-definition

            jndi-name="java:jboss/env/eis/rb/resource2"

            class-name="com.unisys.coms.connector.COMSManagedConnectionFactory">

          <pool>

            <min-pool-size>2</min-pool-size>

            <max-pool-size>20</max-pool-size>

          </pool>

        </connection-definition>

      </connection-definitions>

      <admin-objects>

        <admin-object

            jndi-name="java:/eis/ispec/resource"

            class-name="com.unisys.coms.connector.COMSInteractionSpec2"/>

      </admin-objects>

    </ironjacamar>

    [/code]

     

    Here's the resource-adapter configuration:

     

    [code]

    <resource-adapter>

      <transaction-support>XATransaction</transaction-support>

      <archive>termsrvrRB.ear#termsrvr.rar</archive>

      <connection-definitions>

        <connection-definition

            jndi-name="java:jboss/env/eis/rb/resource"

            class-name="com.unisys.coms.connector.COMSManagedConnectionFactory">

    <!--

          <pool>

            <min-pool-size>2</min-pool-size>

            <max-pool-size>20</max-pool-size>

          </pool>

    -->

        </connection-definition>

        <connection-definition

            jndi-name="java:jboss/env/eis/rb/resource2"

            class-name="com.unisys.coms.connector.COMSManagedConnectionFactory">

    <!--

          <pool>

            <min-pool-size>2</min-pool-size>

            <max-pool-size>20</max-pool-size>

          </pool>

    -->

        </connection-definition>

      </connection-definitions>

      <admin-objects>

        <admin-object

            jndi-name="java:/eis/ispec/resource"

            class-name="com.unisys.coms.connector.COMSInteractionSpec2"/>

      </admin-objects>

    </resource-adapter>

    [/code]

     

     

    How does the recovery manager find the XAResourceRecovery implementation?  Or is it not supported in AS7?  I know it's probably something simple.

     

    Anyway thanks for your help.

  • 3. Re: XAResourceRecovery Configuration in AS7
    Tom Jenkinson Master

    Hi Stan,

     

    My gut feel is that this is a classloader issue, but either way it seems more related to the JCA (or AS7) than raw transaction manager as the configuration requirements are subtly different. I have moved the thread to IronJacamar to reflect that this really boils down to a question on how to configure your resource adapter in AS7, hopefully Jesper will take a look!

     

    Tom

  • 4. Re: XAResourceRecovery Configuration in AS7
    Tom Jenkinson Master

    PS It should definitely be possible to do this so if there isn't a JCA recommended way to do this we can always look at how to make your classes available to the recovery manager.

  • 5. Re: XAResourceRecovery Configuration in AS7
    Jesper Pedersen Master

    Stan, you should probably use either the META-INF/ironjacamar.xml for auto activation of the resource adapter during startup, or the <resource-adapter> element for external activation configuration. Futhermore, you should be using <xa-pool>.

     

    Using a custom implementation of XAResourceRecovery isn't part of the SPI contract between IronJacamar and JBossTS - so it isn't supported (same goes for AS7). What is supported is the ability to specify a recovery plugin for your resource adapter deployment in order to control the lifecycle of the managed connection that is used for recovery.

     

    There are 3 standard implementations:

     

    • org.jboss.jca.core.recovery.DefaultRecoveryPlugin
    • org.jboss.jca.core.recovery.ConfigurableRecoveryPlugin
    • org.jboss.jca.core.recovery.ValidatingManagedConnectionFactoryRecoveryPlugin

     

    which all implements the "org.jboss.jca.core.spi.recovery.RecoveryPlugin" SPI interface. See the <recovery> element for additional details.

  • 6. Re: XAResourceRecovery Configuration in AS7
    Stan Brown Newbie

    Thanks for your help.  I was able to get the recovery to work.  However, it only works if the user-name and password elements are configured; I would've thought that this information would have been retrieved from the resource adapter's deployment descriptor.  But anyway, thanks again – It's much appreciated.

  • 7. Re: XAResourceRecovery Configuration in AS7
    Jesper Pedersen Master

    Make sure that you are running the latest snapshot of AS7 - we have fixed numerous issues since 7.1.1.

  • 8. Re: XAResourceRecovery Configuration in AS7
    Stan Brown Newbie

    I get the same results with jboss-as-7.2.0.Alpha1-SNAPSHOT, but I may need to be a little more patient and wait for the recovery scans to kick in.  Anyway, I’ll check my configuration, do some reading, and try some other tests.  Thanks again.