From 65c596410f7b9c8aeaa0cd38d4b29bbbf614e7c3 Mon Sep 17 00:00:00 2001 From: markt Date: Sun, 22 Nov 2009 19:59:51 +0000 Subject: [PATCH] Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=47997 Process changes to the naming resources for all JNDI contexts, not just the global one. Patch by Michael Allman git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@883134 13f79535-47bb-0310-9956-ffa450edef68 --- java/org/apache/catalina/core/NamingContextListener.java | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/java/org/apache/catalina/core/NamingContextListener.java b/java/org/apache/catalina/core/NamingContextListener.java index 1007e43e3..9e8dfece4 100644 --- a/java/org/apache/catalina/core/NamingContextListener.java +++ b/java/org/apache/catalina/core/NamingContextListener.java @@ -239,6 +239,8 @@ public class NamingContextListener (sm.getString("naming.namingContextCreationFailed", e)); } + namingResources.addPropertyChangeListener(this); + // Binding the naming context to the class loader if (container instanceof Context) { // Setting the context in read only mode @@ -253,7 +255,6 @@ public class NamingContextListener } if (container instanceof Server) { - namingResources.addPropertyChangeListener(this); org.apache.naming.factory.ResourceLinkFactory.setGlobalContext (namingContext); try { @@ -448,9 +449,7 @@ public class NamingContextListener /** - * Process property change events. Currently, only listens to such events - * on the NamingResources instance for the global naming - * resources. + * Process property change events. * * @param event The property change event that has occurred */ @@ -481,7 +480,7 @@ public class NamingContextListener /** - * Process a property change on the global naming resources, by making the + * Process a property change on the naming resources, by making the * corresponding addition or removal to the associated JNDI context. * * @param name Property name of the change to be processed @@ -492,9 +491,6 @@ public class NamingContextListener Object oldValue, Object newValue) { - // NOTE - It seems that the Context for global JNDI resources - // is left in read-write mode, so we do not have to change it here - if (name.equals("ejb")) { if (oldValue != null) { ContextEjb ejb = (ContextEjb) oldValue; -- 2.11.0