Lasha Gureshidze Lasha Gureshidze - 7 days ago 5
MySQL Question

JBoss 7.0.1 xa-datasource exception. javax.transaction.xa.XAException

I use two separate datasources. Using EJB3.0 I was using

non-Xa-datasources
. I have error something like this :
could not open connection
,
state-aware object
. this was , because In one
stateless bean
I was calling second
stateless bean
's method, which was connected diferent database.
Then I change
datasources structure
and change it to
xa-datasources
like this:

<datasources>
<xa-datasource jndi-name="java:/ooo" pool-name="ooo" enabled="true" use-java- context="true">
<xa-datasource-property name="URL">
jdbc:oracle:thin:@xxx.xxx.xxx.xxx:xxxx:orcl
</xa-datasource-property>
<driver>oracle</driver>
<security>
</security>
</xa-datasource>
<xa-datasource jndi-name="java:jboss/mysqlds" pool-name="mysqlds" enabled="true" use-java-context="true">
<xa-datasource-property name="URL">
jdbc:mysql://127.0.0.1/test
</xa-datasource-property>
<driver>mysql</driver>
<security>
</security>
</xa-datasource>
<drivers>
<driver name="oracle" module="com.oracle.ojdbc">
<xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
</driver>
<driver name="mysql" module="com.mysql.jdbc">
<xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class>
</driver>
</drivers>
</datasources>


Therefore I have some error in startup jboss, and I put
mysql module.xml
this (
dependency> javax.transaction.api.
):

<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
</dependencies>


Everything works fine but, there is
warning
every 2 minutes:

11:00:16,213 WARN [com.arjuna.ats.jta] (Periodic Recovery) ARJUNA016027: Local XARecoveryModule.xaRecovery got XA exception XAException.XAER_RMERR: javax.transaction.xa.XAException
at oracle.jdbc.xa.OracleXAResource.recover(OracleXAResource.java:709)
at org.jboss.jca.adapters.jdbc.xa.XAManagedConnection.recover(XAManagedConnection.java:358)
at org.jboss.jca.core.tx.jbossts.XAResourceWrapperImpl.recover(XAResourceWrapperImpl.java:162)
at com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.xaRecovery(XARecoveryModule.java:503) [jbossjts-4.16.2.Final.jar:]
at com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.resourceInitiatedRecoveryForRecoveryHelpers(XARecoveryModule.java:471) [jbossjts-4.16.2.Final.jar:]
at com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.bottomUpRecovery(XARecoveryModule.java:385) [jbossjts-4.16.2.Final.jar:]
at com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.periodicWorkSecondPass(XARecoveryModule.java:166) [jbossjts-4.16.2.Final.jar:]
at com.arjuna.ats.internal.arjuna.recovery.PeriodicRecovery.doWorkInternal(PeriodicRecovery.java:789) [jbossjts-4.16.2.Final.jar:]
at com.arjuna.ats.internal.arjuna.recovery.PeriodicRecovery.run(PeriodicRecovery.java:371) [jbossjts-4.16.2.Final.jar:]

Answer

I solve this problem. Problem was user. this user I using another application, that are running already. I created new user , and everything works fine

Comments