aboutsummaryrefslogtreecommitdiff
path: root/src/jdk.jstatd/share
diff options
context:
space:
mode:
authorGary Adams <gadams@openjdk.org>2019-03-26 07:09:10 -0400
committerGary Adams <gadams@openjdk.org>2019-03-26 07:09:10 -0400
commitafa3178149db141183227b442fbe19ce78d50b1b (patch)
treebe4ce3e189b03a218200ce72f19f2d9e65673fa9 /src/jdk.jstatd/share
parentf9c08cc6fbae1c70f0998949fc74b451e8cea351 (diff)
downloadJetBrainsRuntime-afa3178149db141183227b442fbe19ce78d50b1b.tar.gz
8203026: java.rmi.NoSuchObjectException: no such object in table
Reviewed-by: rriggs, sspitsyn
Diffstat (limited to 'src/jdk.jstatd/share')
-rw-r--r--src/jdk.jstatd/share/classes/sun/tools/jstatd/Jstatd.java9
-rw-r--r--src/jdk.jstatd/share/classes/sun/tools/jstatd/RemoteHostImpl.java5
2 files changed, 8 insertions, 6 deletions
diff --git a/src/jdk.jstatd/share/classes/sun/tools/jstatd/Jstatd.java b/src/jdk.jstatd/share/classes/sun/tools/jstatd/Jstatd.java
index 67c54498a56..54a910c475a 100644
--- a/src/jdk.jstatd/share/classes/sun/tools/jstatd/Jstatd.java
+++ b/src/jdk.jstatd/share/classes/sun/tools/jstatd/Jstatd.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -45,13 +45,14 @@ public class Jstatd {
private static Registry registry;
private static int port = -1;
private static boolean startRegistry = true;
+ private static RemoteHost remoteHost;
private static void printUsage() {
System.err.println("usage: jstatd [-nr] [-p port] [-n rminame]\n" +
" jstatd -?|-h|--help");
}
- static void bind(String name, RemoteHostImpl remoteHost)
+ static void bind(String name, RemoteHost remoteHost)
throws RemoteException, MalformedURLException, Exception {
try {
@@ -138,10 +139,10 @@ public class Jstatd {
try {
// use 1.5.0 dynamically generated subs.
System.setProperty("java.rmi.server.ignoreSubClasses", "true");
- RemoteHostImpl remoteHost = new RemoteHostImpl();
+ remoteHost = new RemoteHostImpl();
RemoteHost stub = (RemoteHost) UnicastRemoteObject.exportObject(
remoteHost, 0);
- bind(name.toString(), remoteHost);
+ bind(name.toString(), stub);
System.out.println("jstatd started (bound to " + name.toString() + ")");
System.out.flush();
} catch (MalformedURLException e) {
diff --git a/src/jdk.jstatd/share/classes/sun/tools/jstatd/RemoteHostImpl.java b/src/jdk.jstatd/share/classes/sun/tools/jstatd/RemoteHostImpl.java
index 20368a4cc0d..be454641de9 100644
--- a/src/jdk.jstatd/share/classes/sun/tools/jstatd/RemoteHostImpl.java
+++ b/src/jdk.jstatd/share/classes/sun/tools/jstatd/RemoteHostImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -50,6 +50,7 @@ public class RemoteHostImpl implements RemoteHost, HostListener {
private MonitoredHost monitoredHost;
private Set<Integer> activeVms;
+ private static RemoteVm rvm;
public RemoteHostImpl() throws MonitorException {
try {
@@ -76,7 +77,7 @@ public class RemoteHostImpl implements RemoteHost, HostListener {
try {
VmIdentifier vmid = new VmIdentifier(vmidStr);
MonitoredVm mvm = monitoredHost.getMonitoredVm(vmid);
- RemoteVmImpl rvm = new RemoteVmImpl((BufferedMonitoredVm)mvm);
+ rvm = new RemoteVmImpl((BufferedMonitoredVm)mvm);
stub = (RemoteVm) UnicastRemoteObject.exportObject(rvm, 0);
}
catch (URISyntaxException e) {