RFR: 8473: JMC silently connects to its own runtime if target runtime does not include management modules

Marcus Hirt hirt at openjdk.org
Wed Dec 3 12:58:23 UTC 2025


On Thu, 27 Nov 2025 17:10:59 GMT, Aymane Harmaz <aharmaz at openjdk.org> wrote:

> This PR addresses the fallback behavior executed when the target jvm runtime does not contain management modules.
> 
> Instead of connecting to the jvm running JMC without informing the user, we explicitly tell the user what went wrong by letting the error propagate 
> 
> The next screenshots show the new error messages for each feature when target jvm runtime does not contain management modules
> 
> JMX Console :
> <img width="534" height="419" alt="jmx-console" src="https://github.com/user-attachments/assets/57c92ba9-75a3-4383-a545-19ba1749bc35" />
> 
> 
> Flight recording : 
> <img width="534" height="419" alt="flight-recording" src="https://github.com/user-attachments/assets/65235113-6780-433f-a449-8d80e93de9f1" />
> 
> 
> Dump Heap : 
> <img width="595" height="150" alt="dump-heap" src="https://github.com/user-attachments/assets/ba11bd57-9cd5-4f51-bb0d-5c2e8c1942db" />
> 
> 
> JMC agent : 
> <img width="595" height="373" alt="jmc-agent" src="https://github.com/user-attachments/assets/9adcac52-4325-41c5-be4c-c29f3b9880ac" />
> 
> 
> 
> Control the remote jmx agent feature was behaving correctly on the right jvm process but in case of an error the root case was not clearly communicated to the user :
> <img width="595" height="373" alt="previous-control-jmx-console" src="https://github.com/user-attachments/assets/859d2bb2-93f4-4e3c-8c70-61084e385d8e" />
> 
> In this PR the error message for controlling the remote jmx agent is explicitly displayed :
> <img width="972" height="502" alt="control-jmx-agent" src="https://github.com/user-attachments/assets/e0e6f88a-99f8-43a4-80a7-95e7babbee5d" />

application/org.openjdk.jmc.console.agent/src/main/java/org/openjdk/jmc/console/agent/actions/AgentEditorOpener.java line 103:

> 101: 							e);
> 102: 				});
> 103: 				return Status.OK_STATUS;

Should this perhaps be CANCEL_STATUS, as we didn't actually connect?

-------------

PR Review Comment: https://git.openjdk.org/jmc/pull/689#discussion_r2585007536


More information about the jmc-dev mailing list