-
Bug
-
Resolution: Done
-
Blocker
-
7.4.0.GA
-
2019 Week 23-25
-
-
User Experience
-
Medium
When creating a new app with rhpam-authoring-ha template with default parameters (which will use mysql as database), the EJB_Timer XA Datasource is failing to connect:
Caused by: java.lang.NoSuchMethodException: Method setPinGlobalTxToPhysicalConnection not found at org.jboss.ironjacamar.jdbcadapters@1.4.15.Final-redhat-00001//org.jboss.jca.adapters.jdbc.util.Injection.inject(Injection.java:139) at org.jboss.ironjacamar.jdbcadapters@1.4.15.Final-redhat-00001//org.jboss.jca.adapters.jdbc.util.Injection.inject(Injection.java:68) at org.jboss.ironjacamar.jdbcadapters@1.4.15.Final-redhat-00001//org.jboss.jca.adapters.jdbc.xa.XAManagedConnectionFactory.getXADataSource(XAManagedConnectionFactory.java:657) ... 21 more
The consequence of this exception can be viewed later in the logs:
[0m�[31m19:59:05,707 ERROR [org.jboss.jca.core.tx.jbossts.XAResourceRecoveryImpl] (Periodic Recovery) IJ000906: Error during crash recovery: java:/jboss/datasources/rhpam_EJBTimer (IJ031084: Unable to create connection): javax.resource.ResourceException: IJ031084: Unable to create connection at org.jboss.ironjacamar.jdbcadapters@1.4.15.Final-redhat-00001//org.jboss.jca.adapters.jdbc.xa.XAManagedConnectionFactory.getXAManagedConnection(XAManagedConnectionFactory.java:531) at org.jboss.ironjacamar.jdbcadapters@1.4.15.Final-redhat-00001//org.jboss.jca.adapters.jdbc.xa.XAManagedConnectionFactory$1$1.run(XAManagedConnectionFactory.java:417) at org.jboss.ironjacamar.jdbcadapters@1.4.15.Final-redhat-00001//org.jboss.jca.adapters.jdbc.xa.XAManagedConnectionFactory$1$1.run(XAManagedConnectionFactory.java:414) at java.base/java.security.AccessController.doPrivileged(Native Method) at java.base/javax.security.auth.Subject.doAs(Subject.java:423) at org.jboss.ironjacamar.jdbcadapters@1.4.15.Final-redhat-00001//org.jboss.jca.adapters.jdbc.xa.XAManagedConnectionFactory$1.run(XAManagedConnectionFactory.java:413) at org.jboss.ironjacamar.jdbcadapters@1.4.15.Final-redhat-00001//org.jboss.jca.adapters.jdbc.xa.XAManagedConnectionFactory$1.run(XAManagedConnectionFactory.java:410) at java.base/java.security.AccessController.doPrivileged(Native Method) at org.jboss.ironjacamar.jdbcadapters@1.4.15.Final-redhat-00001//org.jboss.jca.adapters.jdbc.xa.XAManagedConnectionFactory.createManagedConnection(XAManagedConnectionFactory.java:409) at org.jboss.ironjacamar.impl@1.4.15.Final-redhat-00001//org.jboss.jca.core.tx.jbossts.XAResourceRecoveryImpl.open(XAResourceRecoveryImpl.java:355) at org.jboss.ironjacamar.impl@1.4.15.Final-redhat-00001//org.jboss.jca.core.tx.jbossts.XAResourceRecoveryImpl.getXAResources(XAResourceRecoveryImpl.java:193) at org.jboss.jts.integration//com.arjuna.ats.internal.jbossatx.jta.XAResourceRecoveryHelperWrapper.getXAResources(XAResourceRecoveryHelperWrapper.java:51) at org.jboss.jts//com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.resourceInitiatedRecoveryForRecoveryHelpers(XARecoveryModule.java:591) at org.jboss.jts//com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.periodicWorkFirstPass(XARecoveryModule.java:209) at org.jboss.jts//com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.periodicWorkFirstPass(XARecoveryModule.java:159) at org.jboss.jts//com.arjuna.ats.internal.arjuna.recovery.PeriodicRecovery.doWorkInternal(PeriodicRecovery.java:770) at org.jboss.jts//com.arjuna.ats.internal.arjuna.recovery.PeriodicRecovery.run(PeriodicRecovery.java:382) Caused by: java.sql.SQLNonTransientConnectionException: Could not connect to address=(host=localhost)(port=3306)(type=master) : Connection refused (Connection refused) at org.mariadb//org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper.get(ExceptionMapper.java:175) at org.mariadb//org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper.getException(ExceptionMapper.java:110) at org.mariadb//org.mariadb.jdbc.MariaDbDataSource.getConnection(MariaDbDataSource.java:316) at org.mariadb//org.mariadb.jdbc.MariaDbDataSource.getXAConnection(MariaDbDataSource.java:473) at org.jboss.ironjacamar.jdbcadapters@1.4.15.Final-redhat-00001//org.jboss.jca.adapters.jdbc.xa.XAManagedConnectionFactory.getXAManagedConnection(XAManagedConnectionFactory.java:515) ... 16 more Caused by: java.sql.SQLNonTransientConnectionException: Could not connect to address=(host=localhost)(port=3306)(type=master) : Connection refused (Connection refused) at org.mariadb//org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper.get(ExceptionMapper.java:175) at org.mariadb//org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper.connException(ExceptionMapper.java:83) at org.mariadb//org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol.connectWithoutProxy(AbstractConnectProtocol.java:1111) at org.mariadb//org.mariadb.jdbc.internal.util.Utils.retrieveProxy(Utils.java:502) at org.mariadb//org.mariadb.jdbc.MariaDbConnection.newConnection(MariaDbConnection.java:155) at org.mariadb//org.mariadb.jdbc.MariaDbDataSource.getConnection(MariaDbDataSource.java:313) ... 18 more Caused by: java.net.ConnectException: Connection refused (Connection refused) at java.base/java.net.PlainSocketImpl.socketConnect(Native Method) at java.base/java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:399) at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:242) at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:224) at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:403) at java.base/java.net.Socket.connect(Socket.java:591) at org.mariadb//org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol.connect(AbstractConnectProtocol.java:445) at org.mariadb//org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol.connectWithoutProxy(AbstractConnectProtocol.java:1103) ... 21 more
The full stack trace can be viewed in the attached logs.
The xa-data-source should be reviewed to remove the PinGlobalTxToPhysicalConnection and add it to the URL property instead. Proposed change (needs to be tested):
<xa-datasource jndi-name="java:/jboss/datasources/rhpam_EJBTimer" pool-name="ejb_timer-EJB_TIMER" enabled="true" use-java-context="true" statistics-enabled="${wildfly.datasources.statistics-enabled:${wildfly.statistics-enabled:false}}"> <xa-datasource-property name="DatabaseName">rhpam7</xa-datasource-property> <xa-datasource-property name="EnabledSslProtocolSuites">TLSv1.2</xa-datasource-property> <xa-datasource-property name="Url">jdbc:mariadb://authoring-ha-mysql:3306/rhpam7?enabledSslProtocolSuites=TLSv1.2&PinGlobalTxToPhysicalConnection=true</xa-datasource-property> <xa-datasource-property name="Port">3306</xa-datasource-property> <xa-datasource-property name="ServerName">authoring-ha-mysql</xa-datasource-property> <driver>mariadb</driver> <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation> <xa-pool> <min-pool-size>10</min-pool-size> <max-pool-size>10</max-pool-size> </xa-pool> <security> <user-name>rhpam</user-name> <password>exfTVG6!</password> </security> </xa-datasource>