9 Replies Latest reply on Aug 22, 2012 3:54 AM by malli002

    Database driver problem

    malli002

      I am trying to configure few datasources in my environment and getting below driver problem.

       

      i have tried with ojdbc6.jar file and ojdbc14.jar file in the classpath.

       

      If i use ojdbc6.jar file i will get class not found exception like below with sealing violation ..etc where as if i use ojdbc14.jar file i will get class cast exception. Basically what i understood is it's driver mismatch or something but not able to identify where could be the problem. I have tried all the ways, from my side if anyone have any idea about this or any clue please suggest me. I can give you more clarity on the problem if required.

       

      Few extra details :-

       

      java version - 1.6.0.20

      Jboss version - 5.1

       

       

      Caused by: java.lang.NoClassDefFoundError: oracle/jdbc/driver/OracleDriver

              at oracle.jdbc.pool.OracleDataSource.<init>(OracleDataSource.java:85)

              at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

              at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)

              at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)

              at java.lang.reflect.Constructor.newInstance(Constructor.java:513)

              at java.lang.Class.newInstance0(Class.java:355)

              at java.lang.Class.newInstance(Class.java:308)

              at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.getDriver(LocalManagedConnectionFactory.java:481)

              at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.getLocalManagedConnection(LocalManagedConnectionFactory.java:206)

              ... 98 more

      Caused by: java.lang.ClassNotFoundException: Unexpected error during load of: oracle.jdbc.driver.OracleDriver, msg=Sealing violation for package oracle.jdbc.driver

              at org.jboss.classloader.spi.base.ClassLoaderManager.process(ClassLoaderManager.java:181)

              at org.jboss.classloader.spi.base.BaseClassLoaderDomain.loadClass(BaseClassLoaderDomain.java:276)

              at org.jboss.classloader.spi.base.BaseClassLoaderDomain.loadClass(BaseClassLoaderDomain.java:1138)

              at org.jboss.classloader.spi.base.BaseClassLoader.loadClassFromDomain(BaseClassLoader.java:862)

              at org.jboss.classloader.spi.base.BaseClassLoader.doLoadClass(BaseClassLoader.java:502)

              at org.jboss.classloader.spi.base.BaseClassLoader.loadClass(BaseClassLoader.java:447)

              at java.lang.ClassLoader.loadClass(ClassLoader.java:248)

             ... 107 more

       

       

      Here is my one of DS.xml file

       

       

      <datasources>

            <local-tx-datasource>

              <jndi-name>jdbc/<JNDI NAME></jndi-name>

              <connection-url>jdbc:orcale:thin:@<servername>:<port>:<schema_name></connection-url>

              <driver-class>oracle.jdbc.pool.OracleDataSource</driver-class>

              <security-domain>DataSourceDBLogin</security-domain>

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

              <metadata>

                <type-mapping>Oracle11g</type-mapping>

              </metadata>

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

              <max-pool-size>20</max-pool-size>

              <idle-timeout-minutes>15</idle-timeout-minutes>

            </local-tx-datasource>

          </datasources>

       

        • 1. Re: Database driver problem
          dinukadev

          Hi Areti,

           

          Seems like you have a conflicting ojdbc jar in your classpath within your server. Did you run jfind on the app server libraries to check if one of those contains any oracle jdbc driver classes?

           

           

          Regards,

           

          Dinuka

          • 2. Re: Database driver problem
            malli002

            Hi Dinuka,

             

            thanks for looking it .... what is jfind ?

             

            I would to share one more information that is the same is working in lower environments with the same configuration.

             

            Thanks,

            Malli

            • 3. Re: Database driver problem
              dinukadev

              Hi Areti,

               

              You can download jfind from http://sourceforge.net/project/showfiles.php?group_id=114534

               

              It will show if in your jboss installation, any oracle jdbc driver related classes are within any jar.

               

              Btw what do you mean by lower environments?

               

              Regards,

               

              Dinuka

              • 4. Re: Database driver problem
                malli002

                Thaks for the url.

                 

                This problem i am getting in STAGE environment.

                 

                Lower environment is DEV, UAT ..etc ..there it is working fine with the same Data Source information.

                • 5. Re: Database driver problem
                  malli002

                  Hi ...BTW how to use this jfind.jar file ? can you give me some examples please.

                  • 6. Re: Database driver problem
                    dinukadev

                    Hi Areti,

                     

                     


                    Is it possible to run a GUI in your stage environment? because else this will not work.

                     

                    jfind is a executable jar so you can just double click on it and run. On the dialog that opens, on the first text field, give the path to your jboss installation.

                     

                    On the second text field give the value as "oracle.jdbc.driver.OracleDriver". Then it will show if more than one jar already contains this class file within your jboss installation.

                     

                    Since you said its working fine in DEV and UAT, why not cross reference the libraries to see if they are the same.

                     

                    Regards,

                     

                    Dinuka

                    • 7. Re: Database driver problem
                      malli002

                      Sure, i will try to use this jfind.jar.

                       

                      Yes right ....but i have compared and found no clue or differences between any libraries and classpath ..etc.

                       

                      Please let me know if you have any more ideas like this ...mean while i will try to use jfind and post here my findings.

                      • 8. Re: Database driver problem
                        wdfink

                        It might also happen if there is an application which include the ojdbc*.jar (without classloading separation).

                        Also you should have a look for classes*.jar which is the old oracle jar packaging before Java1.4

                         

                        Also I would check 'oracle.jdbc.driver' package in all jars, not the OracleDriver class itselve, it is possible that another old class will be found by accident and force such problem.

                        • 9. Re: Database driver problem
                          malli002

                          Hi All,

                           

                          I found the problem. it's very silly but made me to think in all different ways. Thank u guys and really appreciate your thoughts because of this silly mistake i learned few other things

                           

                             <connection-url>jdbc:orcale:thin:@<servername>:<port>:<schema_name></connection-url>

                           

                          in my DS.xml i used incorrect spelling of "oracle" like above.