Gaining access to jndi environment variables within a Tomcat LifecycleListener

Posted by rmarimon on Stack Overflow See other posts from Stack Overflow or by rmarimon
Published on 2009-12-16T19:30:33Z Indexed on 2010/04/05 0:03 UTC
Read the original article Hit count: 242

Filed under:

I'm using a LifecycleListener in tomcat to initialize some objects required by contexts in my web server. Within LifecycleListener I would like to have access to GlobalNamingResources Environment variables to keep the configuration for the server inside the server.xml file. When trying various approaches I get the following error:

javax.naming.NameNotFoundException: Name java:comp is not bound in this Context

I'm assuming that the jndi is not initialized by this stage of the server startup process. Any ideas on how to tackle this?

© Stack Overflow or respective owner

Related posts about tomcat