[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Not able to connect to Database using JNDI

ceetu do-not-reply at jboss.com
Thu Feb 28 21:27:47 EST 2008


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

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4133036#4133036

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4133036



More information about the jboss-user mailing list