Project: Tomcat
Bug 29727 JNDI env-entry not reload when context reloaded
Reported: 2004-06-21 22:56:25 | Status: resolved fixed

If environment entries are changed in web.xml, and the application context is restarted, the values in the JNDI context are the old values. If the environment entries are changed via the Tomcat 'admin' interface, then the values provided to the context are correct. The following code is can be used to check the environment: try { InitialContext ic = new InitialContext(); NamingEnumeration enum = ic.listBindings("java:comp/env"); while (enum.hasMore()) { Binding binding = (Binding) enum.next(); jndi.setProperty(binding.getName(), "" + binding.getObject()); System.out.println("jndi setting: " + binding.getName() + "=" + binding.getObject()); } } catch (NamingException e) { System.err.println("unable to read JNDI settings, " + e); } The web.xml fragment looks as follows: <env-entry> <env-entry-name>DatabaseURL</env-entry-name> <env-entry-value>jdbc:hsqldb:hsql://localhost</env-entry-value> <env-entry-type>java.lang.String</env-entry-type> </env-entry>

Files changed in fix:
java/org/apache/catalina/deploy/NamingResources.java