4 Replies Latest reply on Dec 17, 2008 7:07 AM by juanignaciosl

    "Apparently wrong driver class specified for URL: class: ora

    juanignaciosl

      Hello,

      I'm deploying a Seam application with Eclipse at JBoss Server 4.2.3. My database is Oracle 10g XE. I've added to the project classpath the ojdbc14.jar I've found at its installation.

      This is my datasource configuration:

      <datasources>
       <local-tx-datasource>
       <jndi-name>reincideDatasource</jndi-name>
       <connection-url>jdbc:oracle:thin:@localhost:1521:XE</connection-url>
       <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
       <user-name>***</user-name>
       <password>***</password>
       </local-tx-datasource>
      </datasources>
      


      When the server starts it logs this ugly trace:


      10:42:59,000 INFO [DatasourceConnectionProvider] Using datasource: java:/reincideDatasource
      10:42:59,000 WARN [JBossManagedConnectionPool] Throwable while attempting to get a new connection: null
      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:oracle:thin:@localhost:1521:XE)
       at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:190)
       at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnectionEventListener(InternalManagedConnectionPool.java:619)
       at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:264)
       at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:575)
      ...
      Caused by: org.jboss.resource.JBossResourceException: Apparently wrong driver class specified for URL: class: oracle.jdbc.driver.OracleDriver, url: jdbc:oracle:thin:@localhost:1521:XE
       at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.getDriver(LocalManagedConnectionFactory.java:301)
       at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:171)
       ... 166 more
      10:42:59,031 WARN [SettingsFactory] Could not obtain connection metadata
      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:oracle:thin:@localhost:1521:XE); - 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:oracle:thin:@localhost:1521:XE))
       at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:95)
       at org.hibernate.connection.DatasourceConnectionProvider.getConnection(DatasourceConnectionProvider.java:69)
      ...
       at java.lang.Thread.run(Unknown Source)
      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:oracle:thin:@localhost:1521:XE)
       at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:190)
      ...
       ... 158 more
      Caused by: org.jboss.resource.JBossResourceException: Apparently wrong driver class specified for URL: class: oracle.jdbc.driver.OracleDriver, url: jdbc:oracle:thin:@localhost:1521:XE
       at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.getDriver(LocalManagedConnectionFactory.java:301)
       at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:171)
       ... 166 more
      


      Nevertheless, application works. For example:

      10:42:59,281 INFO [SchemaUpdate] Running hbm2ddl schema update
      10:42:59,281 INFO [SchemaUpdate] fetching database metadata
      10:42:59,765 INFO [SchemaUpdate] updating schema
      10:42:59,859 INFO [TableMetadata] table found: REINCIDE.TIPOINCIDENCIA
      10:42:59,859 INFO [TableMetadata] columns: [name, id, version]
      10:42:59,859 INFO [TableMetadata] foreign keys: []
      10:42:59,859 INFO [TableMetadata] indexes: [sys_c003997]
      10:42:59,859 INFO [SchemaUpdate] schema update complete


      What might be wrong?

        • 1. Re:
          morphy

          check the build process to be sure of one of the following:
          * the ojdbc14.jar is in a WEB-INF/lib of your war
          * the ojdbc14.jar is in your ear root and referenced by Class-Path attribute of the manifest files of every archive that requires it
          * the ojdbc14.jar is in you server//lib directory

          hope this can help

          • 2. Re:
            juanignaciosl

            Searching for ojdbc14.jar at server directories returns one only result:

            jboss-4.2.3.GA\server\default\deploy\reincide.war\WEB-INF\lib

            • 3. Re:
              jaikiran

              The JDBC driver jar file is expected to be placed in %JBOSS_HOME%/server/< serverName>/lib folder. It won't be used from the WEB-INF/lib folder.

              • 4. SOLVED
                juanignaciosl

                SOLVED. Thank you very much for your fast support!!!