[jboss-user] [Installation, Configuration & DEPLOYMENT] - Oracle DS/JNDI Issue

bml do-not-reply at jboss.com
Tue Apr 8 11:37:03 EDT 2008


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

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

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



More information about the jboss-user mailing list