Gaining access to jndi environment variables within a Tomcat LifecycleListener
- by rmarimon
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?