0 Replies Latest reply on Feb 12, 2020 8:59 AM by rrajamani2ups.com

    jboss XA datasource for remote sql server failed

    rrajamani2ups.com

      Hi,

       

      I am getting the below error while connecting the SQL server in the remote server configured as XA datasource.

       

       

      23:37:12,074 ERROR [org.jboss.jca.core.tx.jbossts.XAResourceRecoveryImpl] (Periodic Recovery) IJ000906: Error during crash recovery: java:/EWW (IJ031084: Unable to create connection): javax.resource.ResourceException: IJ031084: Unable to create connection

              at org.jboss.jca.adapters.jdbc.xa.XAManagedConnectionFactory.getXAManagedConnection(XAManagedConnectionFactory.java:509)

              at org.jboss.jca.adapters.jdbc.xa.XAManagedConnectionFactory$1$1.run(XAManagedConnectionFactory.java:395)

              at org.jboss.jca.adapters.jdbc.xa.XAManagedConnectionFactory$1$1.run(XAManagedConnectionFactory.java:392)

              at java.security.AccessController.doPrivileged(Native Method)

              at javax.security.auth.Subject.doAs(Subject.java:422)

              at org.jboss.jca.adapters.jdbc.xa.XAManagedConnectionFactory$1.run(XAManagedConnectionFactory.java:391)

              at org.jboss.jca.adapters.jdbc.xa.XAManagedConnectionFactory$1.run(XAManagedConnectionFactory.java:388)

              at java.security.AccessController.doPrivileged(Native Method)

              at org.jboss.jca.adapters.jdbc.xa.XAManagedConnectionFactory.createManagedConnection(XAManagedConnectionFactory.java:387)

              at org.jboss.jca.core.tx.jbossts.XAResourceRecoveryImpl.open(XAResourceRecoveryImpl.java:355)

              at org.jboss.jca.core.tx.jbossts.XAResourceRecoveryImpl.getXAResources(XAResourceRecoveryImpl.java:193)

              at com.arjuna.ats.internal.jbossatx.jta.XAResourceRecoveryHelperWrapper.getXAResources(XAResourceRecoveryHelperWrapper.java:51)

              at com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.resourceInitiatedRecoveryForRecoveryHelpers(XARecoveryModule.java:566)

              at com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.periodicWorkFirstPass(XARecoveryModule.java:189)

              at com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.periodicWorkFirstPass(XARecoveryModule.java:140)

              at com.arjuna.ats.internal.arjuna.recovery.PeriodicRecovery.doWorkInternal(PeriodicRecovery.java:765)

              at com.arjuna.ats.internal.arjuna.recovery.PeriodicRecovery.run(PeriodicRecovery.java:377)

      Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host jdbc:sqlserver://172.17.242.192, port 1433 has failed. Error: "jdbc:sqlserver://172.17.242.192. Verify the connection properties. Make sure that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port. Make sure that TCP connections to the port are not blocked by a firewall.".

              at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(SQLServerException.java:234)

              at com.microsoft.sqlserver.jdbc.SQLServerException.ConvertConnectExceptionToSQLServerException(SQLServerException.java:285)

              at com.microsoft.sqlserver.jdbc.SocketFinder.findSocket(IOBuffer.java:2431)

              at com.microsoft.sqlserver.jdbc.TDSChannel.open(IOBuffer.java:656)

              at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:2472)

              at com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:2142)

              at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectInternal(SQLServerConnection.java:1993)

              at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:1164)

              at com.microsoft.sqlserver.jdbc.SQLServerDataSource.getConnectionInternal(SQLServerDataSource.java:1108)

              at com.microsoft.sqlserver.jdbc.SQLServerPooledConnection.createNewConnection(SQLServerPooledConnection.java:81)

              at com.microsoft.sqlserver.jdbc.SQLServerPooledConnection.<init>(SQLServerPooledConnection.java:56)

              at com.microsoft.sqlserver.jdbc.SQLServerXAConnection.<init>(SQLServerXAConnection.java:36)

              at com.microsoft.sqlserver.jdbc.SQLServerXADataSource.getXAConnection(SQLServerXADataSource.java:60)

              at org.jboss.jca.adapters.jdbc.xa.XAManagedConnectionFactory.getXAManagedConnection(XAManagedConnectionFactory.java:493)

              ... 16 more

       

      standalone-full.xml

       

      <xa-datasource jndi-name="java:/EWW" pool-name="EWW" enabled="true" use-ccm="true">

                          <xa-datasource-property name="ServerName">

                              jdbc:sqlserver://ipaddress

                          </xa-datasource-property>

                          <xa-datasource-property name="PortNumber">1433</xa-datasource-property>

                          <xa-datasource-property name="DatabaseName">

                              EWW

                          </xa-datasource-property>

                          <xa-datasource-property name="SelectMethod">

                              cursor

                          </xa-datasource-property>

                          <driver>microsoft</driver>

                          <security>

                              <user-name>xxxxxx</user-name>

                              <password>xxxxxxx</password>

                          </security>

                          <validation>

                              <valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.mssql.MSSQLValidConnectionChecker"/>

                              <background-validation>true</background-validation>

                          </validation>

                      </xa-datasource>

       

                          <driver name="microsoft" module="com.microsoft">

                              <driver-class>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver-class>

                              <xa-datasource-class>com.microsoft.sqlserver.jdbc.SQLServerXADataSource</xa-datasource-class>

                          </driver>

       

       

      Here are the verification steps followed.

       

      1) Verified the TCP/IP port settings for 1433 in SQL server manager

      2) Updated DTC with XA checkbox

      3) Validated the SQL server user id and password

       

      Please note that the connection works fine from non-XA data source