You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Luca Zago <lz...@e-tree.com> on 2002/09/26 15:11:15 UTC

Problems with JNDI GlobalNamingResources: access outside webapp

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:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>