6 Replies Latest reply on Jan 14, 2009 11:13 AM by Iván Sampedro

    Apparently wrong driver class specified for URL

    dfadf dfa Newbie

      Hi
      I`m using JBoss-4.0.4.GA with oracle db(10g). I have properly configured datasources but after calling DataSource.getConnection(); i receive:


      org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (org.jboss.resource.JBossResourceException: Apparently wrong driver class specified for URL: class: oracle.jdbc.driver.OracleDriver, url: jdbc:thin:@10.111.121.100:1521:orcl)
      at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:177)
      at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnectionEventListener(InternalManagedConnectionPool.java:539)
      at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:228)
      at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:417)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:324)
      at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:301)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:379)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:812)
      at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:88)
      at org.eu.pips.KnowledgeBase.KBSyntacticalTools.management.importing.ImportManagerThread.businessLogic(ImportManagerThread.java:111)
      at org.eu.pips.KnowledgeBase.KBSyntacticalTools.management.workers.WorkerThread.run(WorkerThread.java:30)
      Caused by: org.jboss.resource.JBossResourceException: Apparently wrong driver class specified for URL: class: oracle.jdbc.driver.OracleDriver, url: jdbc:thin:@10.111.121.100:1521:orcl
      at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.getDriver(LocalManagedConnectionFactory.java:274)
      at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:168)
      ... 10 more
      14:31:06,055 ERROR [STDERR] org.jboss.util.NestedSQLException: Could not create connection; - nested throwable: (org.jboss.resource.JBossResourceException: Apparently wrong driver class specified for URL: class: oracle.jdbc.driver.OracleDriver, url: jdbc:thin:@10.111.121.100:1521:orcl); - nested throwable: (org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (org.jboss.resource.JBossResourceException: Apparently wrong driver class specified for URL: class: oracle.jdbc.driver.OracleDriver, url: jdbc:thin:@10.111.121.100:1521:orcl))
      14:31:06,055 ERROR [STDERR] at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:94)
      14:31:06,055 ERROR [STDERR] at org.eu.pips.KnowledgeBase.KBSyntacticalTools.management.importing.ImportManagerThread.businessLogic(ImportManagerThread.java:111)
      14:31:06,055 ERROR [STDERR] at org.eu.pips.KnowledgeBase.KBSyntacticalTools.management.workers.WorkerThread.run(WorkerThread.java:30)
      14:31:06,055 ERROR [STDERR] Caused by: org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (org.jboss.resource.JBossResourceException: Apparently wrong driver class specified for URL: class: oracle.jdbc.driver.OracleDriver, url: jdbc:thin:@10.111.121.100:1521:orcl)
      14:31:06,070 ERROR [STDERR] at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:177)
      14:31:06,070 ERROR [STDERR] at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnectionEventListener(InternalManagedConnectionPool.java:539)
      14:31:06,070 ERROR [STDERR] at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:228)
      14:31:06,070 ERROR [STDERR] at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:417)
      14:31:06,070 ERROR [STDERR] at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:324)
      14:31:06,070 ERROR [STDERR] at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:301)
      14:31:06,070 ERROR [STDERR] at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:379)
      14:31:06,070 ERROR [STDERR] at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:812)
      14:31:06,070 ERROR [STDERR] at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:88)
      14:31:06,070 ERROR [STDERR] ... 2 more
      14:31:06,070 ERROR [STDERR] Caused by: org.jboss.resource.JBossResourceException: Apparently wrong driver class specified for URL: class: oracle.jdbc.driver.OracleDriver, url: jdbc:thin:@10.111.121.100:1521:orcl
      14:31:06,070 ERROR [STDERR] at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.getDriver(LocalManagedConnectionFactory.java:274)
      14:31:06,070 ERROR [STDERR] at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:168)
      14:31:06,070 ERROR [STDERR] ... 10 more
      14:31:07,473 ERROR [STDERR] java.lang.NullPointerException
      14:31:07,473 ERROR [STDERR] at org.eu.pips.KnowledgeBase.KBSyntacticalTools.management.importing.ImportManagerThread.insertLog(ImportManagerThread.java:85)
      14:31:07,473 ERROR [STDERR] at org.eu.pips.KnowledgeBase.KBSyntacticalTools.management.importing.ImportManagerThread.businessLogic(ImportManagerThread.java:119)
      14:31:07,473 ERROR [STDERR] at org.eu.pips.KnowledgeBase.KBSyntacticalTools.management.workers.WorkerThread.run(WorkerThread.java:30)


      My data source configuration file (datasource-ds.xml):


      <?xml version="1.0" encoding="UTF-8" ?>
      <datasources>
      <local-tx-datasource>
      <jndi-name>IntermediateDataModel</jndi-name>
      <connection-url>jdbc:thin:@10.111.121.100:1521:orcl</connection-url>
      <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
      <user-name>intermediatemodel</user-name>
      <password>intermediatemodel</password>
      <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
      <metadata>
      <type-mapping>Oracle9i</type-mapping>
      </metadata>
      </local-tx-datasource>
      </datasources>


      I`m getting proper DataSource from JNDI but calling getConnection() fails for no reason. Most wacky thing is that i tried another datasource wich worked ok. Driver is placed in /server-configuration/lib
      Im using ojdbc14.jar from oracle enterprise 10g. I can log into the database using the same username and password as in ds.xml
      I have tried to find some information on net (including this forum).
      Thank You for help in advance.

      Greetings
      Luke

        • 1. Re: Apparently wrong driver class specified for URL
          dfadf dfa Newbie

          I`m sorry for spamming forum.
          After deleting old ds.xml file and creating new one everything works out :)
          I can`t say way it didn`t work before.

          • 2. Re: Apparently wrong driver class specified for URL
            Wayne Fay Newbie

            It didn't work because you had a bad connection url. You had:
            jdbc:thin:...

            And it should have been:
            jdbc:oracle:thin:...

            • 3. Re: Apparently wrong driver class specified for URL
              Ilya Romanenko Newbie

              Same problem, but connection string looks like correct

              <?xml version="1.0" encoding="UTF-8"?>
              
              <!-- ===================================================================== -->
              <!-- -->
              <!-- JBoss Server Configuration -->
              <!-- -->
              <!-- ===================================================================== -->
              
              <!-- $Id: oracle-ds.xml 63175 2007-05-21 16:26:06Z rrajesh $ -->
              <!-- ==================================================================== -->
              <!-- Datasource config for Oracle originally from Steven Coy -->
              <!-- ==================================================================== -->
              
              
              <datasources>
               <local-tx-datasource>
               <jndi-name>OracleDS</jndi-name>
               <connection-url>jdbc:oracle:thin:@rukus:1521:oracle</connection-url>
               <!--
              
               Here are a couple of the possible OCI configurations.
               For more information, see http://otn.oracle.com/docs/products/oracle9i/doc_library/release2/java.920/a96654/toc.htm
              
               <connection-url>jdbc:oracle:oci:@youroracle-tns-name</connection-url>
               or
               <connection-url>jdbc:oracle:oci:@(description=(address=(host=youroraclehost)(protocol=tcp)(port=1521))(connect_data=(SERVICE_NAME=yourservicename)))</connection-url>
              
               Clearly, its better to have TNS set up properly.
               -->
               <driver-class>oracle.jdbc.OracleDriver</driver-class>
               <user-name>user</user-name>
               <password>secret</password>
               <!-- Uses the pingDatabase method to check a connection is still valid before handing it out from the pool -->
               <!--valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-class-name-->
               <!-- Checks the Oracle error codes and messages for fatal errors -->
               <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
               <!-- sql to call when connection is created
               <new-connection-sql>some arbitrary sql</new-connection-sql>
               -->
              
               <!-- sql to call on an existing pooled connection when it is obtained from pool - the OracleValidConnectionChecker is prefered
               <check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql>
               -->
              
               <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml -->
               <metadata>
               <type-mapping>Oracle9i</type-mapping>
               </metadata>
               </local-tx-datasource>
              
              </datasources>
              


              • 4. Re: Apparently wrong driver class specified for URL
                Ilya Romanenko Newbie

                p.s. it only outputs message and then works fine

                • 5. Re: Apparently wrong driver class specified for URL
                  Ilya Romanenko Newbie

                  p.p.s i've tried oracle.jdbc.driver.OracleDriver too

                  • 6. Re: Apparently wrong driver class specified for URL
                    Iván Sampedro Newbie

                    I have the same problem with jboss AS5 (ver 5.0.0GA) and oracle XE.

                    My Datasource


                    <local-tx-datasource>
                    <jndi-name>jdbc/TelemedicinaLocalDS</jndi-name>
                    <connection-url>jdbc:oracle:thin:@localhost:1521:XE</connection-url>
                    <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
                    <user-name>kekekeke</user-name>
                    kakakaka

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

                    <!-- Checks the Oracle error codes and messages for fatal errors -->
                    <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
                    </local-tx-datasource>



                    this error appears only first time in log, then never again and pool works properly.

                    Any idea?
                    thanks!