You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by GitBox <gi...@apache.org> on 2021/07/09 14:09:10 UTC

[GitHub] [logging-log4j2] sman-81 opened a new pull request #547: LOG4J2-3121: log4j2 config modified at run-time may trigger incomplete MBean re-initialization due to InstanceAlreadyExistsException

sman-81 opened a new pull request #547:
URL: https://github.com/apache/logging-log4j2/pull/547


   â€Ķe MBean re-initialization due to InstanceAlreadyExistsException


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [logging-log4j2] sman-81 edited a comment on pull request #547: LOG4J2-3121: log4j2 config modified at run-time may trigger incomplete MBean re-initialization due to InstanceAlreadyExistsException

Posted by GitBox <gi...@apache.org>.
sman-81 edited a comment on pull request #547:
URL: https://github.com/apache/logging-log4j2/pull/547#issuecomment-877267982


   > @sman-81, given this addresses a bug, I'd appreciate a change in `changes.xml` too. (You can use `dev="ggregory"`.)
   
   Done. I'm still new to the process 😎
   I'm not sure why there's a merge conflict on `changes.xml` now, though.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [logging-log4j2] garydgregory merged pull request #547: LOG4J2-3121 config modified at run-time may trigger incomplete MBean re-initialization due to InstanceAlreadyExistsException

Posted by GitBox <gi...@apache.org>.
garydgregory merged pull request #547:
URL: https://github.com/apache/logging-log4j2/pull/547


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [logging-log4j2] vy commented on pull request #547: LOG4J2-3121 config modified at run-time may trigger incomplete MBean re-initialization due to InstanceAlreadyExistsException

Posted by GitBox <gi...@apache.org>.
vy commented on pull request #547:
URL: https://github.com/apache/logging-log4j2/pull/547#issuecomment-877685229


   @garydgregory, I have resolved the merge conflict. Would you mind squashing & merging this, please? (Cherry-picking into `master` would be great.)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [logging-log4j2] vy commented on pull request #547: LOG4J2-3121: log4j2 config modified at run-time may trigger incomplete MBean re-initialization due to InstanceAlreadyExistsException

Posted by GitBox <gi...@apache.org>.
vy commented on pull request #547:
URL: https://github.com/apache/logging-log4j2/pull/547#issuecomment-877256537


   @sman-81, given this addresses a bug, I'd appreciate a change in `changes.xml` too. (You can use `dev="ggregory"`.)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [logging-log4j2] sman-81 commented on pull request #547: LOG4J2-3121: log4j2 config modified at run-time may trigger incomplete MBean re-initialization due to InstanceAlreadyExistsException

Posted by GitBox <gi...@apache.org>.
sman-81 commented on pull request #547:
URL: https://github.com/apache/logging-log4j2/pull/547#issuecomment-877267982


   > @sman-81, given this addresses a bug, I'd appreciate a change in `changes.xml` too. (You can use `dev="ggregory"`.)
   Done. I'm still new to the process 😎
   I'm not sure why there's a merge conflict on `changes.xml` now, though.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [logging-log4j2] garydgregory edited a comment on pull request #547: LOG4J2-3121 config modified at run-time may trigger incomplete MBean re-initialization due to InstanceAlreadyExistsException

Posted by GitBox <gi...@apache.org>.
garydgregory edited a comment on pull request #547:
URL: https://github.com/apache/logging-log4j2/pull/547#issuecomment-877713591


   Hi @vy 
   I brought this PR into the `release-2.x` branch but I cannot get Eclipse to build anything in master. I'll put some time in to investigate but it might be an aspect of what @rgoers wrote up on the ML. Nonesense like:
   ```
   Description	Resource	Path	Location	Type
   The project was not built due to "Build path contains duplicate entry: 'module-info.java' for project 'log4j-api'". Fix the problem, then try refreshing this project and building it since it may be inconsistent	log4j-api		Unknown	Java Problem
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [logging-log4j2] sman-81 commented on a change in pull request #547: LOG4J2-3121: log4j2 config modified at run-time may trigger incomplete MBean re-initialization due to InstanceAlreadyExistsException

Posted by GitBox <gi...@apache.org>.
sman-81 commented on a change in pull request #547:
URL: https://github.com/apache/logging-log4j2/pull/547#discussion_r667014500



##########
File path: log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/Server.java
##########
@@ -389,7 +389,15 @@ private static void registerAppenders(final LoggerContext ctx, final MBeanServer
 
     private static void register(final MBeanServer mbs, final Object mbean, final ObjectName objectName)
             throws InstanceAlreadyExistsException, MBeanRegistrationException, NotCompliantMBeanException {
+        if (mbs.isRegistered(objectName)) {
+            try {
+                mbs.unregisterMBean(objectName);
+            } catch (MBeanRegistrationException | InstanceNotFoundException _ex) {
+                LOGGER.trace("Failed to unregister MBean {}", objectName);

Review comment:
       Fixed




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [logging-log4j2] garydgregory commented on pull request #547: LOG4J2-3121 config modified at run-time may trigger incomplete MBean re-initialization due to InstanceAlreadyExistsException

Posted by GitBox <gi...@apache.org>.
garydgregory commented on pull request #547:
URL: https://github.com/apache/logging-log4j2/pull/547#issuecomment-877713591


   Hi @vy 
   I brought this PR into the `release-2.x` branch but I cannot get Eclipse to build anything in master. I'll put some time in to investigate but it might be an aspect of what @rgoers wrote up on the ML.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [logging-log4j2] garydgregory commented on a change in pull request #547: LOG4J2-3121: log4j2 config modified at run-time may trigger incomplete MBean re-initialization due to InstanceAlreadyExistsException

Posted by GitBox <gi...@apache.org>.
garydgregory commented on a change in pull request #547:
URL: https://github.com/apache/logging-log4j2/pull/547#discussion_r667002497



##########
File path: log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/Server.java
##########
@@ -389,7 +389,15 @@ private static void registerAppenders(final LoggerContext ctx, final MBeanServer
 
     private static void register(final MBeanServer mbs, final Object mbean, final ObjectName objectName)
             throws InstanceAlreadyExistsException, MBeanRegistrationException, NotCompliantMBeanException {
+        if (mbs.isRegistered(objectName)) {
+            try {
+                mbs.unregisterMBean(objectName);
+            } catch (MBeanRegistrationException | InstanceNotFoundException _ex) {
+                LOGGER.trace("Failed to unregister MBean {}", objectName);

Review comment:
       No underscores please, _ex -> ex




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org