nightmare 07.05.12.a: OC4j 10.1.2 data sources - JNDI name not found
Date: 25 May 2007 00:43:51 -0700
Message-ID: <1180079031.095287.164580_at_x18g2000prd.googlegroups.com>
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:oracle:thin:_at_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/orionapplication.
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 Received on Fri May 25 2007 - 09:43:51 CEST