Author: markt
Date: Sun Nov 22 19:59:51 2009
New Revision: 883134

URL: http://svn.apache.org/viewvc?rev=883134&view=rev
Log:
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

Modified:
    tomcat/trunk/java/org/apache/catalina/core/NamingContextListener.java

Modified: tomcat/trunk/java/org/apache/catalina/core/NamingContextListener.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/NamingContextListener.java?rev=883134&r1=883133&r2=883134&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/NamingContextListener.java 
(original)
+++ tomcat/trunk/java/org/apache/catalina/core/NamingContextListener.java Sun 
Nov 22 19:59:51 2009
@@ -239,6 +239,8 @@
                     (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 @@
             }
 
             if (container instanceof Server) {
-                namingResources.addPropertyChangeListener(this);
                 org.apache.naming.factory.ResourceLinkFactory.setGlobalContext
                     (namingContext);
                 try {
@@ -448,9 +449,7 @@
 
 
     /**
-     * Process property change events.  Currently, only listens to such events
-     * on the <code>NamingResources</code> instance for the global naming
-     * resources.
+     * Process property change events.
      *
      * @param event The property change event that has occurred
      */
@@ -481,7 +480,7 @@
 
 
     /**
-     * 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 @@
                                               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;



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to