You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by bu...@apache.org on 2006/08/14 11:59:25 UTC

DO NOT REPLY [Bug 40246] New: - HierarchyDynamicMBean missing unregister MBean

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

http://issues.apache.org/bugzilla/show_bug.cgi?id=40246

           Summary: HierarchyDynamicMBean missing unregister MBean
           Product: Log4j
           Version: 1.2
          Platform: Other
        OS/Version: other
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Other
        AssignedTo: log4j-dev@logging.apache.org
        ReportedBy: wingtung.leung@gmail.com


(log4j-1.2.13)

I'm using log4j in a WebLogic J2EE application and added an JMX interface using
the existing HierarchyDynamicMBean. During and after the first registration of
the MBean, everything seems to work fine. But when I unregister the MBean and
register it again (because of redeploying the application), I get a stacktrace
indicating that the appender MBean is already registered.

As far as I understand by reading the code, the HierarchyDynamicMBean registers
the logger(s) but never unregisters them. I would expected automatic
unregistration of the logger(s) when I unregister the HierarchyDynamicMBean,
probably somewhere in preDeregister().

Since the addLoggerMBean() returns you the object name, the calling code can
perform the cleanup itself as well, but that is IMHO not the option to prefer.
In case you want to stick to this behaviour, the method needs at least some
explicit javadoc comment explaining it.

If someone gives a hint which direction is the best, I'm willing to write a
small patch.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


DO NOT REPLY [Bug 40246] - HierarchyDynamicMBean missing unregister MBean

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

http://issues.apache.org/bugzilla/show_bug.cgi?id=40246





------- Additional Comments From psmith@apache.org  2007-04-23 16:20 -------
1.2.15 consideration

Although this patch is targetted for trunk, it would need slight rework for
inclusion in the 1.2 tree, because it uses JDK 1.2+ Collections framework plus
the use of the getLogger() calls.  

If we consider this for the 1.2 tree, then it'll need to port that to standard
java.util.Vector class, and use LogLog instead.  If the original author was able
to, a patch against the 1.2 tree would be well received, otherwise I might take
a stab at it later.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


DO NOT REPLY [Bug 40246] - HierarchyDynamicMBean missing unregister MBean

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

http://issues.apache.org/bugzilla/show_bug.cgi?id=40246


psmith@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|psmith@apache.org           |log4j-dev@logging.apache.org




------- Additional Comments From psmith@apache.org  2007-04-29 15:21 -------
Reassigning this one back to log4j-dev list, it was my mistake to completely
reassign this issue, it prevents the comments from being seen on the mailing list.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


DO NOT REPLY [Bug 40246] - HierarchyDynamicMBean missing unregister MBean

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

http://issues.apache.org/bugzilla/show_bug.cgi?id=40246





------- Additional Comments From wingtung.leung@gmail.com  2006-08-14 12:25 -------
Created an attachment (id=18715)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=18715&action=view)
Patch JMX MBean classes to perform automatic cleanup

This patch solves my problem and unregisters all MBean instances during
undeployment. My previously described workaround is not working because some
MBean instances are added automatically without needing the explicit
addLoggerMBean() call.

Please review for inclusion.


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


DO NOT REPLY [Bug 40246] - HierarchyDynamicMBean missing unregister MBean

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

http://issues.apache.org/bugzilla/show_bug.cgi?id=40246


psmith@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED




-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


DO NOT REPLY [Bug 40246] - HierarchyDynamicMBean missing unregister MBean

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

http://issues.apache.org/bugzilla/show_bug.cgi?id=40246





------- Additional Comments From psmith@apache.org  2007-04-29 16:19 -------
Created an attachment (id=20072)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=20072&action=view)
log4j 1.2 version of the mbean deregister patch

I modified the original patch (which I had to apply by hand, wasn't quite a
unified diff format) to make it log4j 1.2 compatible.

I've had difficulty testing this however, because I can't seem to get the
preDeregister method to fire at all.  I can't work out exactly what the correct
way to 'shutdown' the JMX agent in my test harness app I have local.

If someone else knew what to do to verify behaviour, could they take the patch
and try it out?

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


DO NOT REPLY [Bug 40246] - HierarchyDynamicMBean missing unregister MBean

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

http://issues.apache.org/bugzilla/show_bug.cgi?id=40246


psmith@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|log4j-dev@logging.apache.org|psmith@apache.org




-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org