I have a problem with JNDI name not found on looking up a data-source
in OC4J 10.1.2.
It is a very simple application that uses simple DAO and a Struts data
source for data access and has been working well. But the application
has developed heavy traffic and the client has asked that we add
connection pooling through Oracle.
Oracle documentation seems to be clear, but I seem to be missing
something. Note that we have to use 10.1.2 and that 10.1.3 approaches
do not work for 10.1.2.
Here are what I believe to be the relevant snippets. What is the
problem?
The java lookup:
<code>
InitialContext ic = new InitialContext();
DataSource dataSource = (DataSource) ic.lookup("jdbc/pool/OracleDS");
</code>
JNDI complains "name not found".
The META-INF/data-sources.xml
file:
<code>
<data-sources>
data-source
class="oracle.jdbc.pool.OracleConnectionCacheImpl"
name="OracleDS"
location="jdbc/pool/OracleDS"
ejb-name="jdbc/pool/OracleDS"
pooled-location="jdbc/mssPooledDS"
url="jdbc

racle:thin:@1n.n.n.n:1521/AAAAAA"
username="user"
password="secret"
min-connections="5"
max-connections="15"
wait-timeout="10"
inactivity-timeout="30"
schema="database-schemas/oracle.xml"
/>
</data-sources>
</code>
Note that in the META-INF/orion-application.xml
the data source is declared twice
<?xml version="1.0"?>
<!DOCTYPE orion-application PUBLIC "-//Evermind//DTD J2EE Application
runtime 1.2//EN" "http://xmlns.oracle.com/ias/dtds/orion-
application.dtd">
<orion-application deployment-version="9.0.3.0.0" default-data-
source="jdbc/pool/OracleDS">
<web-module id="myweb" path="myweb.war" />
<persistence path="persistence" />
......
<data-sources path="./data-sources.xml"/>
</orion-application>
WEB-INF/web.xml
<web-app>
,,,,
<resource-ref>
<res-ref-name>jdbc/pool/OracleDS</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
....
</web-app>
Thanks