diff --git a/src/java.management/share/classes/com/sun/jmx/remote/internal/ServerNotifForwarder.java b/src/java.management/share/classes/com/sun/jmx/remote/internal/ServerNotifForwarder.java index f15c416f296..fb24055cc8f 100644 --- a/src/java.management/share/classes/com/sun/jmx/remote/internal/ServerNotifForwarder.java +++ b/src/java.management/share/classes/com/sun/jmx/remote/internal/ServerNotifForwarder.java @@ -162,10 +162,22 @@ public class ServerNotifForwarder { connectionId, name, getSubject()); } + // 6238731: set the default domain if no domain is set. + ObjectName nn = name; + if (name.getDomain() == null || name.getDomain().isEmpty()) { + try { + nn = ObjectName.getInstance(mbeanServer.getDefaultDomain(), + name.getKeyPropertyList()); + } catch (MalformedObjectNameException mfoe) { + // impossible, but... + throw new IOException(mfoe.getMessage(), mfoe); + } + } + Exception re = null; for (int i = 0 ; i < listenerIDs.length ; i++) { try { - removeNotificationListener(name, listenerIDs[i]); + removeNotificationListener(nn, listenerIDs[i]); } catch (Exception e) { // Give back the first exception // diff --git a/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt index 4b483a4b076..1ae9623ef14 100644 --- a/test/jdk/ProblemList.txt +++ b/test/jdk/ProblemList.txt @@ -563,8 +563,6 @@ javax/management/monitor/DerivedGaugeMonitorTest.java 8042211 generic- javax/management/remote/mandatory/connection/BrokenConnectionTest.java 8262312 linux-all -javax/management/remote/mandatory/notif/EmptyDomainNotificationTest.java 8343838 generic-all - ############################################################################ # jdk_net