tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Luca Zago" <lz...@e-tree.com>
Subject Problems with JNDI GlobalNamingResources: access outside webapp
Date Thu, 26 Sep 2002 13:11:15 GMT
Hi,
I have some problems with a JNDI look up.
I have my classes to in a web app, but in a jar in tomact common/lib, I 
put my jndi resourse in the GlobalNamingResources in the server.xml and 
I use this code to access the context.

Context initCtx = new InitialContext();
Context envCtx = (Context) initCtx.lookup("java:comp/env");
ds = (DataSource)envCtx.lookup(datasource);

I got the error:
initialization failed : Name comp is not bound in this Context

it doesn't find the context..because it's out of a webapp..
Does somebody  know how to call the global context from the code?
is it possible to get access to the context outside a webapp?

Thanks,


-- 
Luca Zago
Senior IT Developer
_____________________________________________________

E-TREE S.p.a.  Via Fonderia 43 - 31100 Treviso (Italy)
phone +39.0422.3107
fax   +39.0422.310888
http://www.e-tree.com          http://www.webanana.com
_____________________________________________________


--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message