Search code examples
jbossatg

Unable to connect to data source because of SQLException


In ATG 10.2 facing some problem while running Motorprise application on JBOSS and using MySQLServer.

Unable to connect to data source because of SQLException: Could not enlist in transaction on entering meta-aware object!;
CONTAINER:atg.repository.RepositoryException; SOURCE:org.jboss.util.NestedSQLException:     Could not enlist in transaction on entering meta-aware object!; - nested throwable: (javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImple < ac, BasicAction: a618a4b:d503:525e
689c:1db status: ActionStatus.ABORT_ONLY >); - nested throwable: (org.jboss.resource.JBossResourceException: Could not enlist in transaction on entering meta-aware object!; - nested throwable: (javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImple < ac, BasicActi
on: a618a4b:d503:525e689c:1db status: ActionStatus.ABORT_ONLY >))
    at atg.adapter.gsa.GSAItemDescriptor.executeQuery(GSAItemDescriptor.java:8347)

Solution

  • JBoss by default assumes XA drivers and does not support calling multiple non-XA resources within the same transaction. To enable multiple non-XA resources in JBoss, add the property com.arjuna.ats.jta.allowMultipleLastResources to the jbossjta-properties.xml file, under the <property depends="arjuna" name="jta"> tag:

    <property depends="arjuna" name="jta">
      <property name="com.arjuna.ats.jta.allowMultipleLastResources" value="true"/>
    

    You may still see warnings in your log file, but ATG applications will run correctly. To suppress these warnings, add the following to your jboss-log4j.xml file:

    <category name="com.arjuna.atg.jta.logging">
      <priority value="ERROR"/>
    </category>
    

    This was the case in ATG 9.3 and I assume still holds true. Another quick reference to the cause is here