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 2008/10/01 22:43:01 UTC

DO NOT REPLY [Bug 45932] New: Log4j JMX MBeans not cleaned up

https://issues.apache.org/bugzilla/show_bug.cgi?id=45932

           Summary: Log4j JMX MBeans not cleaned up
           Product: Log4j
           Version: 1.2
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Other
        AssignedTo: log4j-dev@logging.apache.org
        ReportedBy: hmak@vaultus.com


LogManager.resetConfiguration() does not drop the JMX MBeans created by
HierarchyDynamicMBean.

When executed twice, the following

        MBeanServer mbs = ...;
        Properties props = ...;
        HierarchyDynamicMBean hdm = new HierarchyDynamicMBean();
        mbs.registerMBean(hdm, new ObjectName("log4j:hiearchy=default"));

        Enumeration<Logger> iter = (Enumeration<Logger>)
LogManager.getLoggerRepository().getCurrentLoggers();
        while (iter.hasMoreElements()) {
                hdm.addLoggerMBean(iter
                          .nextElement()
                          .getName());
        }

        LogManager.resetConfiguration();
        PropertyConfigurator.configure(props);

throws

        org.apache.log4j.jmx.LoggerDynamicMBean <ERROR  > Could not add
appenderMBean for [F].
        javax.management.InstanceAlreadyExistsException: log4j:appender=F
                at
com.sun.jmx.mbeanserver.RepositorySupport.addMBean(RepositorySupport.java:452)
                at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.internal_addObject(DefaultMBeanServerInterceptor.java:1410)
                at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerObject(DefaultMBeanServerInterceptor.java:936)
                at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:337)
                at
com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:497)
                at
org.apache.log4j.jmx.LoggerDynamicMBean.registerAppenderMBean(Unknown Source)
                at
org.apache.log4j.jmx.LoggerDynamicMBean.handleNotification(Unknown Source)
                at
javax.management.NotificationBroadcasterSupport.handleNotification(NotificationBroadcasterSupport.java:221)
                at
javax.management.NotificationBroadcasterSupport.sendNotification(NotificationBroadcasterSupport.java:184)
                at
org.apache.log4j.jmx.HierarchyDynamicMBean.addAppenderEvent(Unknown Source)
                at
org.apache.log4j.Hierarchy.fireAddAppenderEvent(Hierarchy.java:192)
                at org.apache.log4j.Category.addAppender(Category.java:162)
                at
org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator.java:614)
                at
org.apache.log4j.PropertyConfigurator.configureRootCategory(PropertyConfigurator.java:509)
                at
org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:415)
                at
org.apache.log4j.PropertyConfigurator.configure(PropertyConfigurator.java:349)
                ...


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

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