dcsimg
JNDI Datasource problem
3 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Chris_Hudson
Posted On:   Friday, November 7, 2003 06:17 AM

Hi, I'm having some problems with WSAD 5.1 trial that don't occur if I use Tomcat 4.1. I have a jdbc datasource configured and tested on the server. I can connect to this datasource by doing ... InitialContext ctx = new InitialContext(); ds = (DataSource) ctx.lookup("jdbc/myOraDB"); However if I try and use a local resource ref and try InitialContext c = new InitialContext(); ds = (DataSource) c.lookup("java:comp/env/jdbc/myOraDB"); I get the error javax.naming.NameNotFoundException: Name "comp/env/jdbc/myOraDB"" not found in context "java:" I have also tried adding a simeple String resour   More>>

Hi,

I'm having some problems with WSAD 5.1 trial that don't occur if I use Tomcat 4.1. I have a jdbc datasource configured and tested on the server. I can connect to this datasource by doing ...

			
InitialContext ctx = new InitialContext();
ds = (DataSource) ctx.lookup("jdbc/myOraDB");

However if I try and use a local resource ref and try
			
InitialContext c = new InitialContext();
ds = (DataSource) c.lookup("java:comp/env/jdbc/myOraDB");

I get the error
			
javax.naming.NameNotFoundException: Name "comp/env/jdbc/myOraDB"" not found in context "java:"


I have also tried adding a simeple String resource environment variable to the web.xml and still get the above error when I try
			
String temp = (String)initContext.lookup("java:comp/env/tempString");


All of this works fine in tomcat with NO changes to anything.
Has anyone else had any similar problems or can think of anything with the server config I have missed?    <<Less

Re: JNDI Datasource problem

Posted By:   Sanjay_Sharma  
Posted On:   Monday, January 19, 2004 01:52 AM

Hi chris,

while looking up for the resources, from any independent client

always use

cell/nodes/localhost/servers/server1/

and then look up
here for

Localhost and server1
check ur wsad environemnt

Re: JNDI Datasource problem

Posted By:   Malini_Nagaraj  
Posted On:   Thursday, December 11, 2003 09:56 AM

Hi Chris ,
I am facing the same problem too. Did you find any solutions to this?


Thanks in advance,

Malini

Re: JNDI Datasource problem

Posted By:   Anonymous  
Posted On:   Sunday, November 16, 2003 11:12 PM

add this into your web.xml:



DataSource
jdbc/myOraDB
javax.sql.DataSource
Container


Make sure that its right after taglib definitions or welcome file list definitions.

About | Sitemap | Contact