dbTalk Databases Forums  

nightmare 07.05.12.a: OC4j 10.1.2 data sources - JNDI name not found

comp.databases.oracle.tools comp.databases.oracle.tools


Discuss nightmare 07.05.12.a: OC4j 10.1.2 data sources - JNDI name not found in the comp.databases.oracle.tools forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
holiday
 
Posts: n/a

Default nightmare 07.05.12.a: OC4j 10.1.2 data sources - JNDI name not found - 05-25-2007 , 02:43 AM







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="jdbcracle: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


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.