You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2021/07/10 22:40:00 UTC

[jira] [Commented] (LOG4J2-3121) log4j2 config modified at run-time may trigger incomplete MBean re-initialization due to InstanceAlreadyExistsException

    [ https://issues.apache.org/jira/browse/LOG4J2-3121?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17378543#comment-17378543 ] 

ASF subversion and git services commented on LOG4J2-3121:
---------------------------------------------------------

Commit 59204c45d0b4c6542ad9ff887a5d67c75b9fdc8a in logging-log4j2's branch refs/heads/release-2.x from Markus Spann
[ https://gitbox.apache.org/repos/asf?p=logging-log4j2.git;h=59204c4 ]

LOG4J2-3121 config modified at run-time may trigger incomplete MBean re-initialization due to InstanceAlreadyExistsException (#547)

* LOG4J2-3121: log4j2 config modified at run-time may trigger incomplete MBean re-initialization due to InstanceAlreadyExistsException

* LOG4J2-3121: Update for codestyle

* LOG4J2-3121: Updated changes.xml with bugfix info

Co-authored-by: Markus Spann <Ma...@baaderbank.de>
Co-authored-by: Volkan Yazıcı <vo...@gmail.com>

> log4j2 config modified at run-time may trigger incomplete MBean re-initialization due to InstanceAlreadyExistsException
> -----------------------------------------------------------------------------------------------------------------------
>
>                 Key: LOG4J2-3121
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-3121
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.14.1
>            Reporter: Markus Spann
>            Priority: Major
>
> We occasionally encounter an {{InstanceAlreadyExistsException}} during log4j2 reconfiguration after update to the configuration file at run-time. This causes the MBean initialization to be incomplete.
> The exception can be suppressed by checking whether the MBean is registered and de-registering it first. I will provide a pull request.
> {noformat}
> 2021-07-09 14:37:37,961 Log4j2-TF-1-ConfiguratonFileWatcher-3 ERROR Could not register mbeans javax.management.InstanceAlreadyExistsException: org.apache.logging.log4j2:type=5c29bfd
>  at java.management/com.sun.jmx.mbeanserver.Repository.addMBean(Repository.java:436)
>  at java.management/com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerWithRepository(DefaultMBeanServerInterceptor.java:1855)
>  at java.management/com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerDynamicMBean(DefaultMBeanServerInterceptor.java:955)
>  at java.management/com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerObject(DefaultMBeanServerInterceptor.java:890)
>  at java.management/com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:320)
>  at java.management/com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:522)
>  at org.apache.logging.log4j.core.jmx.Server.register(Server.java:393)
>  at org.apache.logging.log4j.core.jmx.Server.reregisterMBeansAfterReconfigure(Server.java:168)
>  at org.apache.logging.log4j.core.jmx.Server.reregisterMBeansAfterReconfigure(Server.java:141)
>  at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:638)
>  at org.apache.logging.log4j.core.LoggerContext.onChange(LoggerContext.java:763)
>  at org.apache.logging.log4j.core.util.AbstractWatcher$ReconfigurationRunnable.run(AbstractWatcher.java:93)
>  at java.base/java.lang.Thread.run(Thread.java:834){noformat}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)