title: Gaining access to jndi environment variables within a Tomcat LifecycleListener
body: <p>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:</p>
  
  <pre><code>javax.naming.NameNotFoundException: Name java:comp is not bound in this Context
  </code></pre>
  
  <p>I'm assuming that the jndi is not initialized by this stage of the server startup process.  Any ideas on how to tackle this?  </p>