DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17985>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17985

NamingContextListener not added as ContainerListener and PropertyChangeListener

           Summary: NamingContextListener not added as ContainerListener and
                    PropertyChangeListener
           Product: Tomcat 4
           Version: 4.1.18
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Catalina
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


hi,

When a StandardContext is started, the following code adds the 
NamingContextListener to the standard context. However, as one can see from the 
code, the NamingContextListener is not being added as a ContainerListener and a 
PropertyChangeListener (it's only added as a LifeCycleListener). Due to this, 
calling addResource(), remoteResource() etc on the context does not result in 
the NamingContextListener being notified, which results in the JNDI bindings of 
the context not reflecting the change.

-- Code from StandardContext.java --
        if (ok && isUseNaming()) {
            if (namingContextListener == null) {
                namingContextListener = new NamingContextListener();
                namingContextListener.setDebug(getDebug());
                namingContextListener.setName(getNamingContextName());
                addLifecycleListener(namingContextListener);
            }
        }
-- End of code

-- Patched code should be:
        if (ok && isUseNaming()) {
            if (namingContextListener == null) {
                namingContextListener = new NamingContextListener();
                namingContextListener.setDebug(getDebug());
                namingContextListener.setName(getNamingContextName());
                addLifecycleListener(namingContextListener);
                addContainerListener(namingContextListener);
                addPropertyChangeListener(namingContextListener);
            }
        }
-- End of Patch

thanks,
parag.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to