2 Replies Latest reply on Apr 9, 2008 1:36 PM by BML BML

    Oracle DS/JNDI Issue

    BML BML Newbie

      Hi,

      I am currently trying to access an Oracle datasource via JNDI that I have configured. I am using JBoss 4.0.3 on Windows XP Pro with Oracle 10g.

      The datasource seems to be binding correctly as I get the following message when I start the server:

      [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=OracleDS' to JNDI name 'java:OracleDS'
      


      The problem is that when I try to lookup the datasource in my application I can't get a reference to it. There are no errors thrown, but the datasource is null. Here is the code:

      DataSource dataSource = (DataSource)new InitialContext().lookup("java:OracleDS");
      


      Here is the oracle-ds.xml file that I am using:

      <?xml version="1.0" encoding="UTF-8"?>
      <datasources>
       <local-tx-datasource>
       <jndi-name>OracleDS</jndi-name>
       <connection-url>jdbc:oracle:thin:@//db.mydomain.com:1521/dbsid</connection-url>
       <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
       <user-name>user</user-name>
       <password>pwd</password>
       <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
       </local-tx-datasource>
      </datasources>
      



      Any help would be much appreciated. Thanks,

      barry