From 2b65cbb3e8f9c3cd7b53ab6baa14e5f38b6a2f04 Mon Sep 17 00:00:00 2001 From: Keith Wall Date: Wed, 21 May 2014 22:16:07 +0000 Subject: QPID-5779: Workaround sporadic test failure. It seems sometimes the JMX Plugin's RMI sockets are closed (by the RMI TCP Accept thread) *after* the Broker has stopped. I can't find a way to avoid this issue. Work around by awaiting the ports to become free within the test. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1596702 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/qpid/server/jmx/QpidRMIServerSocketFactory.java | 2 +- .../qpid/server/jmx/RegistryProtectingRMIServerSocketFactory.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'qpid/java/broker-plugins') diff --git a/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/QpidRMIServerSocketFactory.java b/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/QpidRMIServerSocketFactory.java index 54ddf75044..2ad4f6af74 100644 --- a/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/QpidRMIServerSocketFactory.java +++ b/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/QpidRMIServerSocketFactory.java @@ -71,6 +71,6 @@ class QpidRMIServerSocketFactory implements RMIServerSocketFactory @Override public boolean equals(final Object obj) { - return getClass() == obj.getClass(); + return obj != null && getClass() == obj.getClass(); } } \ No newline at end of file diff --git a/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/RegistryProtectingRMIServerSocketFactory.java b/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/RegistryProtectingRMIServerSocketFactory.java index 45c65faf59..432d84fc42 100644 --- a/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/RegistryProtectingRMIServerSocketFactory.java +++ b/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/RegistryProtectingRMIServerSocketFactory.java @@ -64,7 +64,7 @@ class RegistryProtectingRMIServerSocketFactory implements RMIServerSocketFactory @Override public boolean equals(final Object obj) { - return getClass() == obj.getClass(); + return obj != null && getClass() == obj.getClass(); } private static class NoLocalAddressServerSocket extends ServerSocket -- cgit v1.2.1