Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions src/jdk.jconsole/share/classes/sun/tools/jconsole/ProxyClient.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2004, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2004, 2025, 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
Expand Down Expand Up @@ -34,6 +34,7 @@
import static java.lang.management.ManagementFactory.*;
import java.lang.ref.WeakReference;
import java.lang.reflect.*;
import java.net.URI;
import java.rmi.*;
import java.rmi.registry.*;
import java.rmi.server.*;
Expand Down Expand Up @@ -133,7 +134,24 @@ private ProxyClient(String url,
this.advancedUrl = url;
this.connectionName = getConnectionName(url, userName);
this.displayName = connectionName;
setParameters(new JMXServiceURL(url), userName, password);
JMXServiceURL jmxServiceURL = new JMXServiceURL(url);
setParameters(jmxServiceURL, userName, password);
if ("rmi".equals(jmxServiceURL.getProtocol())) {
String path = jmxServiceURL.getURLPath();
if (path.startsWith("/jndi/")) {
int end = path.indexOf(';');
if (end < 0) end = path.length();
String registryURIStr = path.substring(6, end);
URI registryURI = URI.create(registryURIStr);
if ("rmi".equals(registryURI.getScheme())
&& "/jmxrmi".equals(registryURI.getPath())) {
this.registryHostName = registryURI.getHost();
this.registryPort = registryURI.getPort();
this.vmConnector = true;
checkSslConfig();
}
}
}
}

private ProxyClient(LocalVirtualMachine lvm) throws IOException {
Expand Down