QPID-8355: [Broker-J] Improve exception handling on instantiation of JMX MBeans
diff --git a/broker-core/src/main/java/org/apache/qpid/server/model/AbstractContainer.java b/broker-core/src/main/java/org/apache/qpid/server/model/AbstractContainer.java
index 868e933..2114ea8 100644
--- a/broker-core/src/main/java/org/apache/qpid/server/model/AbstractContainer.java
+++ b/broker-core/src/main/java/org/apache/qpid/server/model/AbstractContainer.java
@@ -137,7 +137,7 @@
             String maxDirectMemoryAsString = (String)getValue.invoke(vmOption);
             maxMemory = Long.parseLong(maxDirectMemoryAsString);
         }
-        catch (ClassNotFoundException | NoSuchMethodException | IllegalAccessException e)
+        catch (ClassNotFoundException | NoSuchMethodException | IllegalAccessException | IllegalArgumentException e)
         {
             LOGGER.debug("Cannot determine direct memory max size using com.sun.management.HotSpotDiagnosticMXBean: " + e.getMessage());
         }
diff --git a/broker-core/src/main/java/org/apache/qpid/server/model/BrokerAttributeInjector.java b/broker-core/src/main/java/org/apache/qpid/server/model/BrokerAttributeInjector.java
index 5709c6c..42d108e 100644
--- a/broker-core/src/main/java/org/apache/qpid/server/model/BrokerAttributeInjector.java
+++ b/broker-core/src/main/java/org/apache/qpid/server/model/BrokerAttributeInjector.java
@@ -71,7 +71,7 @@
                     ManagementFactory.getPlatformMXBean((Class<? extends PlatformManagedObject>) hotSpotDiagnosticMXBeanClass);
 
         }
-        catch (ClassNotFoundException e)
+        catch (IllegalArgumentException | ClassNotFoundException e)
         {
             LOGGER.debug("Cannot find com.sun.management.HotSpotDiagnosticMXBean MXBean: " + e);
         }