1 Reply Latest reply on Feb 29, 2008 4:51 AM by jaikiran

    Not able to connect to Database using JNDI

    ceetu

      HI,

      I am trying to connect to Oracle9i Database using JNDI lookup and Datasource. I have modified oracle-ds.xml file as follows:
      <?xml version="1.0" encoding="UTF-8"?>

      <local-tx-datasource>
      <jndi-name>OracleDS</jndi-name>
      <connection-url>jdbc:oracle:oci:@host:1521:SID</connection-url>
      <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
      <user-name>system</user-name>
      system
      <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>

      <type-mapping>Oracle9i</type-mapping>

      </local-tx-datasource>


      I copied this oracle-ds.xml into deploy folder. I have also modified the files standardjaws.xml and standardjbosscmp-jdbc.xml.

      The lookup is working fine. I am able to create DataSource object. But the connection is not happening. I am getting the following error:

      org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (org.jboss.resource.JBossResourceException: Apparent
      ly wrong driver class specified for URL: class: oracle.jdbc.driver.OracleDriver, url: jdbc:oracle:oci:@naph:1521:NAPH)
      at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:161)
      at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnectionEventListener(InternalManagedConnectionPool.java:5
      08)

      I have also copied ojdbc14.jar file in WEB-INF/lib and set the system classpath.

      Am I missing anything else here? Please help me......

      Thanks in advance