8 Replies Latest reply on May 8, 2013 5:07 AM by Nicklas Karlsson

    OracleValidConnectionChecker in JBOSS 7.1.3 ?

    ANAND KUMAR GEORGE PREM KUMAR Newbie

      I am migrating application from jboss 4.3 to Jboss 7.1.3 Final.

       

      I have used Iron Jacamar Tool to translate the datasource configuration xml from jboss 4.3 to jboss 7.1.3 and the validation part translated as below (Complete translated datasource attached for reference).    In Jboss 4.3, Jboss's properietory jar file "jboss-common-jdbc-wrapper.jar" is used to perform this validation. Incase of Jboss 7.1.3 is there any equivalent feature ?

       

       

       

      <validation>

                              <valid-connection-checker class-name="org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker"/>

                              <validate-on-match>false</validate-on-match>

                              <background-validation>false</background-validation>

                              <use-fast-fail>false</use-fast-fail>

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

                          </validation>

        • 1. Re: OracleValidConnectionChecker in JBOSS 7.1.3 ?
          Nicklas Karlsson Master

          org.jboss.jca.adapters.jdbc.extensions.oracle.OracleValidConnectionChecker

          • 2. Re: OracleValidConnectionChecker in JBOSS 7.1.3 ?
            Nicklas Karlsson Master

            If you get classnotfoundexceptions you might have to setup a dependency between the jdbcadapters-module and the oracle driver module, can't remember.

            • 3. Re: OracleValidConnectionChecker in JBOSS 7.1.3 ?
              ANAND KUMAR GEORGE PREM KUMAR Newbie

              Thanks Nicklas.

               

              I just had a look at the Installed modules in my Jboss AS 7.1.3.Final, But don't find any directory structure relevant to the package  org.jboss.jca.adapters.jdbc.extensions.oracle.OracleValidConnectionChecker

               

              Should i install the module for jca explicitly and itz dependencies as well ?

              • 5. Re: OracleValidConnectionChecker in JBOSS 7.1.3 ?
                ANAND KUMAR GEORGE PREM KUMAR Newbie

                Hi Nicklas,


                yes i tried as advised, But ended up getting the below oracle driver error. I use ojdbc14.jar as oracle driver to connect to Oracle 10g database. But the method "pingDatabase" appearning in the below stack trace is not present in the oracle driver jar ojdbc14.jar.

                 

                 

                 

                ersionUpgrader_LocalHome of EJB: com.cassis.cx.upgrade.VersionUpgrader, java:jboss/datasources/MM7_SHARED=org.jboss.jca.adapters.jdbc.WrapperDataSource@1223041}

                15:08:56,596 INFO  [stdout] (Thread-121) The value of cacheByJNDIName obj 1 in doLookup method isorg.jboss.jca.adapters.jdbc.WrapperDataSource@12bd971

                15:08:56,597 WARN  [org.jboss.jca.adapters.jdbc.extensions.oracle.OracleValidConnectionChecker] (Thread-121) Unexpected error in pingDatabase: java.lang.NoSuchMethodException: oracle.jdbc.driver.T4CConnection.pingDatabase()

                        at java.lang.Class.getMethod(Class.java:1605) [rt.jar:1.6.0_29]

                        at org.jboss.jca.adapters.jdbc.extensions.oracle.OracleValidConnectionChecker.isValidConnection(OracleValidConnectionChecker.java:61) [ironjacamar-jdbc-1.0.13.Final-redhat-1.jar:1.0.13.Final-redhat-1]

                        at org.jboss.jca.adapters.jdbc.BaseWrapperManagedConnectionFactory.isValidConnection(BaseWrapperManagedConnectionFactory.java:1097) [ironjacamar-jdbc-1.0.13.Final-redhat-1.jar:1.0.13.Final-redhat-1]

                        at org.jboss.jca.adapters.jdbc.BaseWrapperManagedConnection.checkValid(BaseWrapperManagedConnection.java:501) [ironjacamar-jdbc-1.0.13.Final-redhat-1.jar:1.0.13.Final-redhat-1]

                        at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.matchManagedConnections(LocalManagedConnectionFactory.java:464) [ironjacamar-jdbc-1.0.13.Final-redhat-1.jar:1.0.13.Final-redhat-1]

                        at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreArrayListManagedConnectionPool.getConnection(SemaphoreArrayListManagedConnectionPool.java:284)

                        at org.jboss.jca.core.connectionmanager.pool.AbstractPool.getTransactionNewConnection(AbstractPool.java:495)

                        at org.jboss.jca.core.connectionmanager.pool.AbstractPool.getConnection(AbstractPool.java:374)

                        at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.getManagedConnection(AbstractConnectionManager.java:329)

                        at org.jboss.jca.core.connectionmanager.tx.TxConnectionManagerImpl.getManagedConnection(TxConnectionManagerImpl.java:368)

                        at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.allocateConnection(AbstractConnectionManager.java:464)

                        at org.jboss.jca.adapters.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:139) [ironjacamar-jdbc-1.0.13.Final-redhat-1.jar:1.0.13.Final-redhat-1]

                        at com.cassis.cx.base.JDBCPersistenceManagerBase.getConnection(JDBCPersistenceManagerBase.java:211) [MobileMatrixCX-1.0.0-SNAPSHOT.jar:]

                        at com.cassis.cx.job.JobJDBCMgr.updateWithActiveJob(JobJDBCMgr.java:318) [MobileMatrixCX-1.0.0-SNAPSHOT.jar:]

                        at com.cassis.cx.job.Job_Bean.ejbStore(Job_Bean.java:118) [MobileMatrixCX-1.0.0-SNAPSHOT.jar:]

                        at sun.reflect.GeneratedMethodAccessor35.invoke(Unknown Source) [:1.6.0_29]

                        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_29]

                • 6. Re: OracleValidConnectionChecker in JBOSS 7.1.3 ?
                  Nicklas Karlsson Master

                  And you can't upgrade to ojdbc6.jar? Of course you could write your own based on the source code (or check older implementations in previous JBoss versions)

                  • 7. Re: OracleValidConnectionChecker in JBOSS 7.1.3 ?
                    ANAND KUMAR GEORGE PREM KUMAR Newbie

                    Thanks Nicklas.

                     

                    I have upgraded to ojdbc6.jar and the error is no more.

                     

                    and the earlier jar ojdbc14.jar is not JDBC 4.0 compliant as well .  So now the problem is fixed. Thanks for the suggestion.

                    • 8. Re: OracleValidConnectionChecker in JBOSS 7.1.3 ?
                      Nicklas Karlsson Master

                      I've used ojdbc6.jar for years now with both 10g and 11g DB:s and can't recall any issues.