Skip to content

8347114: JMXServiceURL should require an explicit protocol #25674

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

kevinjwalls
Copy link
Contributor

@kevinjwalls kevinjwalls commented Jun 6, 2025

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.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change requires CSR request JDK-8359130 to be approved
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issues

  • JDK-8347114: JMXServiceURL should require an explicit protocol (Enhancement - P4)
  • JDK-8359130: JMXServiceURL should require an explicit protocol (CSR)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/25674/head:pull/25674
$ git checkout pull/25674

Update a local copy of the PR:
$ git checkout pull/25674
$ git pull https://git.openjdk.org/jdk.git pull/25674/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 25674

View PR using the GUI difftool:
$ git pr show -t 25674

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/25674.diff

Using Webrev

Link to Webrev Comment

@kevinjwalls
Copy link
Contributor Author

/csr

@bridgekeeper
Copy link

bridgekeeper bot commented Jun 6, 2025

👋 Welcome back kevinw! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Jun 6, 2025

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk openjdk bot added the csr Pull request needs approved CSR before integration label Jun 6, 2025
@openjdk
Copy link

openjdk bot commented Jun 6, 2025

@kevinjwalls has indicated that a compatibility and specification (CSR) request is needed for this pull request.

@kevinjwalls please create a CSR request for issue JDK-8347114 with the correct fix version. This pull request cannot be integrated until the CSR request is approved.

@openjdk
Copy link

openjdk bot commented Jun 6, 2025

@kevinjwalls The following label will be automatically applied to this pull request:

  • serviceability

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@kevinjwalls kevinjwalls marked this pull request as ready for review June 6, 2025 15:24
@openjdk openjdk bot added the rfr Pull request is ready for review label Jun 6, 2025
@mlbridge
Copy link

mlbridge bot commented Jun 6, 2025

Webrevs

@kevinjwalls
Copy link
Contributor Author

(Test was missing from original commit.)

@dfuch
Copy link
Member

dfuch commented Jun 10, 2025

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.

@kevinjwalls
Copy link
Contributor Author

Thanks Daniel, yes there is a possibility of flushing out some niche dependencies on the odd behaviour, will go ahead with CSR and release note.

@kevinjwalls kevinjwalls changed the title 8347114: JMXServiceURL with null protocol defaults to jmxmp 8347114: JMXServiceURL should require an explicit protocol Jun 10, 2025
@kevinjwalls
Copy link
Contributor Author

CSR detail added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
csr Pull request needs approved CSR before integration rfr Pull request is ready for review serviceability [email protected]
Development

Successfully merging this pull request may close these issues.

2 participants