Q:

JBoss-5 throws NameNotFoundException with arjuna and MySQL-5

I get the following exception upon deploying my EE application to JBoss-5.1.0.GA:
2013-08-12 12:00:40,363    WARN    [com.arjuna.ats.internal.jta.recovery.xarecovery1] Local XARecoveryModule.xaRecovery  got XA exception javax.transaction.xa.XAException: Error trying to connect to provider java:/DefaultJMSProvider, XAException.XAER_RMERR       com.arjuna.ats.jta.logging.loggerI18N   Thread-12
2013-08-12 12:00:40,363 ERROR   ********************************Failed to connect to server "javax.naming.NameNotFoundException: DefaultJMSProvider not bound
    at org.jnp.server.NamingServer.getBinding(NamingServer.java:771)
    at org.jnp.server.NamingServer.getBinding(NamingServer.java:779)
    at org.jnp.server.NamingServer.getObject(NamingServer.java:785)
    at org.jnp.server.NamingServer.lookup(NamingServer.java:443)
    at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:726)
    at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686)
    at javax.naming.InitialContext.lookup(InitialContext.java:392)
    at org.jboss.jms.server.recovery.MessagingXAResourceWrapper.getConnectionFactory(MessagingXAResourceWrapper.java:343)
    at org.jboss.jms.server.recovery.MessagingXAResourceWrapper.connect(MessagingXAResourceWrapper.java:300)
    at org.jboss.jms.server.recovery.MessagingXAResourceWrapper.getDelegate(MessagingXAResourceWrapper.java:259)
    at org.jboss.jms.server.recovery.MessagingXAResourceWrapper.recover(MessagingXAResourceWrapper.java:107)
    at com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.xaRecovery(XARecoveryModule.java:795)
    at com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.resourceInitiatedRecovery(XARecoveryModule.java:665)
    at com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.getNewXAResource(XARecoveryModule.java:244)
    at com.arjuna.ats.internal.jta.resources.arjunacore.XAResourceRecord.getNewXAResource(XAResourceRecord.java:1257)
    at com.arjuna.ats.internal.jta.resources.arjunacore.XAResourceRecord.restore_state(XAResourceRecord.java:1092)
    at com.arjuna.ats.arjuna.coordinator.RecoveryAbstractRecord.restore_state(RecoveryAbstractRecord.java:214)
    at com.arjuna.ats.arjuna.coordinator.BasicAction.restore_state(BasicAction.java:1482)
    at com.arjuna.ats.arjuna.coordinator.BasicAction.activate(BasicAction.java:717)
    at com.arjuna.ats.arjuna.coordinator.BasicAction.activate(BasicAction.java:679)
    at com.arjuna.ats.arjuna.recovery.RecoverAtomicAction.<init>(RecoverAtomicAction.java:60)
    at com.arjuna.ats.internal.arjuna.recovery.AtomicActionRecoveryModule.doRecoverTransaction(AtomicActionRecoveryModule.java:178)
    at com.arjuna.ats.internal.arjuna.recovery.AtomicActionRecoveryModule.processTransactionsStatus(AtomicActionRecoveryModule.java:294)
    at com.arjuna.ats.internal.arjuna.recovery.AtomicActionRecoveryModule.periodicWorkSecondPass(AtomicActionRecoveryModule.java:128)
    at com.arjuna.ats.internal.arjuna.recovery.PeriodicRecovery.doWorkInternal(PeriodicRecovery.java:799)
    at com.arjuna.ats.internal.arjuna.recovery.PeriodicRecovery.run(PeriodicRecovery.java:412)" org.jboss.jms.server.recovery.MessagingXAResourceWrapper    Thread-12
In my opinion, this points to a problem in my default datasource, which currently looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<datasources>
    <xa-datasource>
        <jndi-name>DefaultDS</jndi-name>
        <use-java-context>true</use-java-context>
        <user-name>my-user</user-name>
        <password>passwd</password>
        <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
        <xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class>
        <xa-datasource-property name="URL">jdbc:mysql://localhost:3306/MyDb?allowMultiQueries=true</xa-datasource-property>
        <xa-datasource-property name="DefaultFetchSize">1000</xa-datasource-property>
        <xa-resource-timeout>3600</xa-resource-timeout>
        <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name>
        <!-- Timeouts -->
        <set-tx-query-timeout>false</set-tx-query-timeout>
        <!-- Caches -->
        <prepared-statement-cache-size>0</prepared-statement-cache-size>
        <share-prepared-statements>0</share-prepared-statements>
        <!-- pooling parameters -->
        <use-strict-min>true</use-strict-min>
        <min-pool-size>5</min-pool-size>
        <max-pool-size>30</max-pool-size>
        <blocking-timeout-millis>60000</blocking-timeout-millis>
        <idle-timeout-minutes>5</idle-timeout-minutes>
        <prefill>true</prefill>
        <!-- use commit to avoid MySQL XA-Exception -->
        <new-connection-sql>SELECT 1;commit</new-connection-sql>
        <check-valid-connection-sql>SELECT 1;commit</check-valid-connection-sql>
        <track-statements>yes</track-statements>
        <no-tx-separate-pools/>
        <track-connection-by-tx>true</track-connection-by-tx>
        <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
        <metadata>
            <type-mapping>mySQL</type-mapping>
        </metadata>
    </xa-datasource>
</datasources>

The strangest point is actually that DefaultDS seems to work outside of arjuna.
Anyone knows a fix for this?

A:

Looks like for some strange reason MySQL/arjuna needs some additional configuration 
[...]
<user-name>my-user</user-name>
<password>passwd</password>
[...]
seems to be as important as:
[...]
<xa-datasource-property name="User">my-user</xa-datasource-property>
<xa-datasource-property name="Password">passwd</xa-datasource-property>
[...]
Works fine now. :)

