Repository: logging-log4j2
Updated Branches:
  refs/heads/master c1265b65f -> 92b26b41f


LOG4J2-1581 Unregistering JMX components no longer prints a stack trace when 
the MBean has already been unregistered.


Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/92b26b41
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/92b26b41
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/92b26b41

Branch: refs/heads/master
Commit: 92b26b41fd20992104ed9a58cf0f0c326dd682d2
Parents: c1265b6
Author: rpopma <rpo...@apache.org>
Authored: Sun Sep 18 17:01:08 2016 +0900
Committer: rpopma <rpo...@apache.org>
Committed: Sun Sep 18 17:01:08 2016 +0900

----------------------------------------------------------------------
 .../src/main/java/org/apache/logging/log4j/core/jmx/Server.java   | 3 +++
 src/changes/changes.xml                                           | 3 +++
 2 files changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/92b26b41/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/Server.java
----------------------------------------------------------------------
diff --git 
a/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/Server.java 
b/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/Server.java
index 4da63e6..0476a90 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/Server.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/Server.java
@@ -25,6 +25,7 @@ import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 
 import javax.management.InstanceAlreadyExistsException;
+import javax.management.InstanceNotFoundException;
 import javax.management.MBeanRegistrationException;
 import javax.management.MBeanServer;
 import javax.management.NotCompliantMBeanException;
@@ -343,6 +344,8 @@ public final class Server {
             for (final ObjectName objectName : found) {
                 mbs.unregisterMBean(objectName);
             }
+        } catch (final InstanceNotFoundException ex) {
+            LOGGER.debug("Could not unregister MBeans for " + search + ". 
Ignoring " + ex);
         } catch (final Exception ex) {
             LOGGER.error("Could not unregister MBeans for " + search, ex);
         }

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/92b26b41/src/changes/changes.xml
----------------------------------------------------------------------
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index bcc511e..c109a92 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -39,6 +39,9 @@
       <action issue="LOG4J2-1582" dev="rpopma" type="fix">
         When initializing on platforms where JMX is not available, 
Interpolator component no longer prints stack trace for warning messages.
       </action>
+      <action issue="LOG4J2-1581" dev="rpopma" type="fix">
+        Unregistering JMX components no longer prints a stack trace when the 
MBean has already been unregistered.
+      </action>
       <action issue="LOG4J2-1313" dev="rpopma" type="fix" due-to="Philipp 
Knobel, Leon Finker">
         Support Property values to be specified in configuration as a value 
attribute as well as an element.
       </action>

Reply via email to