Bug 47997 - NamingContextListener fails to add itself as a PropertyChangeListener to all namingResources
Summary: NamingContextListener fails to add itself as a PropertyChangeListener to all ...
Alias: None
Product: Tomcat 5
Classification: Unclassified
Component: Catalina (show other bugs)
Version: 5.5.28
Hardware: Macintosh Mac OS X 10.4
: P2 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
Depends on:
Reported: 2009-10-14 17:45 UTC by Michael Allman
Modified: 2010-03-09 22:37 UTC (History)
1 user (show)

proposed fix (1000 bytes, patch)
2009-10-14 17:45 UTC, Michael Allman
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Allman 2009-10-14 17:45:53 UTC
Created attachment 24378 [details]
proposed fix

In the NamingContextListener.lifecycleEvent(LifecycleEvent) method, the
NamingContextListener object fails to add itself as a PropertyChangeListener to
namingResources whose context is not a Server, e.g. a Context instance.  This
prevents the NamingResourcesMBean from working with non-Server contexts.
Comment 1 Michael Allman 2009-10-28 11:49:41 UTC
I just want to add that without this patch, the standard Admin app functionality of adding a DataSource to a deployed Web app does not work.  (Adding a DataSource dynamically is my app's use case as well, incidentally.)
Comment 2 Mark Thomas 2009-11-22 12:02:47 UTC
Thanks for the patch. It has been applied to trunk and proposed for 6.0.x and 5.5.x
Comment 3 Mark Thomas 2009-12-21 08:22:20 UTC
This has been fixed in 6.0.x and will be included in 6.0.21 onwards. Thanks again for the patch.
Comment 4 Michael Allman 2009-12-21 12:39:18 UTC
Can this please be applied to 5.5.x and released with 5.5.29?  I ask because my client is using a patched (with this patch) version of 5.5.28 in production and I'd like to simplify their upgrades by obviating the need to patch and build future releases of 5.5.x.  Thanks.
Comment 5 Mark Thomas 2010-03-09 22:37:31 UTC
The patch has been applied to 5.5.x and will be included in 5.5.29 onwards. Again, thanks for the patch.