RFR: 8347114: JMXServiceURL with null protocol defaults to jmxmp [v2]

Daniel Fuchs dfuchs at openjdk.org
Tue Jun 10 11:34:30 UTC 2025


On Mon, 9 Jun 2025 15:22:17 GMT, Kevin Walls <kevinw at openjdk.org> wrote:

>> Remove the historic oddity that JMXServiceURL defaults to jmxmp if a null protocol is specified.
>> 
>> This has been the case for JMXServiceURL constructors that take individual parameters, but not for JMXServiceURL(String serviceURL), which enforces that there must be a protocol (If empty in the String, it throws: java.net.MalformedURLException: Missing or invalid protocol name: "")
>> 
>> A missing (null) protocol should throw a MalformedURLException for all constructors.
>> 
>> JMXMP was never part of the JDK, but a separate component in the historic JMX Remote reference implementation.
>> 
>> While we are here, remove the last remaining JMXMP references in the source:
>> 
>> src/java.management/share/classes/javax/management/remote/JMXConnectorServerMBean.java:     * (JMXMP Connector and RMI Connector).</p>
>> src/java.management/share/classes/javax/management/remote/JMXConnectorServer.java:     * (JMXMP Connector and RMI Connector).</p>
>> 
>> These doc references are just examples of Connectors that support generation of client stubs.  There is no need for JMXMP to be mentioned here.
>
> Kevin Walls has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Add test

Marked as reviewed by dfuchs (Reviewer).

This change introduces a potential compatibility with application that may be using third-party implementations of the JMXMP protocol. I do not believe JMXMP is widely used, but I could be wrong. I agree that defaulting to the "jmxmp" protocol when `null` is supplied is odd, since the only standard (non optional) connector is the RMI Connector. Changing the specification and behaviour looks therefore a desirable cleanup. 
I see that you have planned a CSR, which is good. Make sure to also add a release note.

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

PR Review: https://git.openjdk.org/jdk/pull/25674#pullrequestreview-2913146449
PR Comment: https://git.openjdk.org/jdk/pull/25674#issuecomment-2958810096


More information about the serviceability-dev mailing list