3 Replies Latest reply on Apr 20, 2018 4:59 PM by Vamshi Krishna

    Issue with XA Datasource and xa-datasource class (EAP7)

    Vamshi Krishna Newbie

      Hey there, I am configuring an XA-datasource (Informix XA) in EAP7 environment and below is the configuration piece from domain.xml and having trouble with getting this datasource configured correctly.  Can anyone help me in resolving this issue, thanks in advance !!

       

      Configuration from domain.xml

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

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

                                  jdbc:informix-sqli://DBHost:1526/DBName:informixServer=InformixServerName

                              </xa-datasource-property>

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

                                  com.informix.jdbcx.IfxXADataSource

                              </xa-datasource-property>

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

                                  username

                              </xa-datasource-property>

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

                                  Password

                              </xa-datasource-property>

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

                                  InformixServerName

                              </xa-datasource-property>

                              <driver>informix</driver>

                              <new-connection-sql>set lock mode to wait 4;set isolation to cursor stability;</new-connection-sql>

                              <xa-pool>

                                  <min-pool-size>5</min-pool-size>

                                  <max-pool-size>150</max-pool-size>

                              </xa-pool>

                              <validation>

                                  <check-valid-connection-sql>select * from sysmaster:sysdual</check-valid-connection-sql>

                                  <exception-sorter class-name="org.jboss.resource.adapter.jdbc.vendor.InformixExceptionSorter"/>

                              </validation>

                              <timeout>

                                  <idle-timeout-minutes>5</idle-timeout-minutes>

                              </timeout>

                              <statement>

                                  <prepared-statement-cache-size>100</prepared-statement-cache-size>

                              </statement>

                          </xa-datasource>

       

      DRIVER: DRIVER-CLASS

       

                              <driver name="informix" module="com.informix.jdbc">

                                  <driver-class>com.informix.jdbc.IfxDriver</driver-class>

                                  <xa-datasource-class>com.informix.jdbcx.IfxXADataSource</xa-datasource-class>

                              </driver>

       

       

       

      ERROR:

       

      2018-04-18 16:17:06,400 ERROR [org.jboss.jca.core.tx.jbossts.XAResourceRecoveryImpl] (Periodic Recovery) IJ000906: Error during crash recovery: java:/XADS (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:543)

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

              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: javax.resource.ResourceException: IJ031102: Failed to load XA datasource: com.informix.jdbcx.IfxXADataSource

              at org.jboss.jca.adapters.jdbc.xa.XAManagedConnectionFactory.getXADataSource(XAManagedConnectionFactory.java:640)

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

              ... 15 more

      Caused by: java.lang.NoSuchMethodException: Method setInformixServer not found

              at org.jboss.jca.adapters.jdbc.util.Injection.inject(Injection.java:139)

              at org.jboss.jca.adapters.jdbc.util.Injection.inject(Injection.java:68)

              at org.jboss.jca.adapters.jdbc.xa.XAManagedConnectionFactory.getXADataSource(XAManagedConnectionFactory.java:635)

              ... 16 more

       

      2018-04-18 16:23:36,437 ERROR [org.jboss.jca.core.tx.jbossts.XAResourceRecoveryImpl] (Periodic Recovery) IJ000906: Error during crash recovery: java:/XADS (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:543)

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

              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: java.sql.SQLException: INFORMIXSERVER has to be specified

              at com.informix.util.IfxErrMsg.getSQLException(IfxErrMsg.java:413)

              at com.informix.jdbc.IfxSqliConnect.<init>(IfxSqliConnect.java:1037)

              at com.informix.jdbcx.IfxXAReusableConnection.<init>(IfxXAReusableConnection.java:56)

              at com.informix.jdbcx.IfxXAPooledConnection.<init>(IfxXAPooledConnection.java:103)

              at com.informix.jdbcx.IfxXADataSource.getXAConnection(IfxXADataSource.java:98)

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

              ... 15 more

        • 1. Re: Issue with XA Datasource and xa-datasource class (EAP7)
          Wolfgang Mayer Master

          Acording to the Informix JDBC Driver Programmer’s Guide the DataSource property for the INFORMIXSERVER connection property is serverName and not InformixServer.

          Did you try this?

          • 2. Re: Issue with XA Datasource and xa-datasource class (EAP7)
            Frank Langelage Master

            This is my working setup:

            <!-- Informix XA -->
            <xa-datasource jndi-name="java:jboss/datasources/DefaultDS" enabled="true" use-java-context="true" pool-name="DefaultDS" spy="false">
                <driver>ifxjdbc.jar</driver>
                <xa-datasource-class>com.informix.jdbcx.IfxXADataSource</xa-datasource-class>
                <xa-datasource-property name="IfxIFXHOST">...</xa-datasource-property>
                <xa-datasource-property name="PortNumber">9088</xa-datasource-property>
                <xa-datasource-property name="DatabaseName">...</xa-datasource-property>
                <xa-datasource-property name="ServerName">...</xa-datasource-property>
                <!-- optional, use as needed -->
                <xa-datasource-property name="IfxLOBCACHE">-1</xa-datasource-property>
                <xa-datasource-property name="IfxIFX_ISOLATION_LEVEL">2U</xa-datasource-property>
                <xa-datasource-property name="IfxIFX_LOCK_MODE_WAIT">11</xa-datasource-property>
                <xa-datasource-property name="IfxNEWCODESET">8859_15,8859-1,819</xa-datasource-property>
                <xa-datasource-property name="IfxDB_LOCALE">en_US.819</xa-datasource-property>
            
                <security>
                    <user-name>...</user-name>
                    <password>...</password>
                </security>
                <xa-pool>
                    <is-same-rm-override>false</is-same-rm-override>
                    <no-tx-separate-pools>true</no-tx-separate-pools>
                </xa-pool>
                <validation>
                    <validate-on-match>true</validate-on-match>
                    <check-valid-connection-sql>select 1 from sysmaster:sysdual</check-valid-connection-sql>
                    <exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.informix.InformixExceptionSorter"/>
                </validation>
                <statement>
                    <prepared-statement-cache-size>128</prepared-statement-cache-size>
                </statement>
            </xa-datasource>
            
            

             

            Adjust as needed.

            • 3. Re: Issue with XA Datasource and xa-datasource class (EAP7)
              Vamshi Krishna Newbie

              Thanks Frank & Mayer, for some reason when i tried last time with different set of configuration by utilizing xa-datasource-property it didn't work but it's now working.

               

               

                                  <xa-datasource jndi-name="java:/jboss/datasources/XADS" pool-name="XADS">

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

                                          IfxIFXHOST

                                      </xa-datasource-property>

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

                                          1526

                                      </xa-datasource-property>

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

                                          serverName

                                      </xa-datasource-property>

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

                                          databaseName

                                      </xa-datasource-property>

                                      <driver>informix</driver>

                                      <new-connection-sql>set lock mode to wait 4;set isolation to cursor stability</new-connection-sql>

                                      <xa-pool>

                                          <min-pool-size>5</min-pool-size>

                                          <max-pool-size>150</max-pool-size>

                                      </xa-pool>

                                      <security>

                                          <user-name>username</user-name>

                                          <password>password</password>

                                      </security>

                                      <validation>

                                          <check-valid-connection-sql>select * from sysmaster:sysdual</check-valid-connection-sql>

                                          <exception-sorter class-name="org.jboss.resource.adapter.jdbc.vendor.InformixExceptionSorter"/>

                                      </validation>

                                      <timeout>

                                          <idle-timeout-minutes>5</idle-timeout-minutes>

                                      </timeout>

                                      <statement>

                                          <prepared-statement-cache-size>100</prepared-statement-cache-size>

                                      </statement>

                                  </xa-datasource>

                                  <drivers>