JDK-8334165 : Remove serialVersionUID compatibility logic from JMX
  • Type: Enhancement
  • Component: core-svc
  • Sub-Component: javax.management
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2024-06-12
  • Updated: 2024-09-16
  • Resolved: 2024-09-12
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 24
24 b15Fixed
Related Reports
CSR :  
Relates :  
Sub Tasks
JDK-8339664 :  
JDK-8340074 :  
Description
Various JMX classes are serializable, but unlike most serializable classes, they compute a serialVersionUID value instead of defining that value as a constant. The reason for this is for serialization compatibility with JMX 1.0. These classes used certain SVUID values in 1.0 and different values in 1.1 and later; thus, by default, 1.0 was serialization incompatible with 1.1 and later.

There is a switch to change the behavior. If the `jmx.serial.form` system property is set to "1.0" these classes will use the "old" SVUID values corresponding to those used in 1.0; otherwise they will use the "new" SVUID values for 1.1 and later. This enables the JMX running in a given JVM to be compatible with 1.0 or with 1.1-and-later, but not both.

JMX 1.0 is very old at this point -- not sure exactly how old -- and so it seems unnecessary to continue to support this compatibility mode. It should eventually be removed. Initially this likely involves deprecating the `jmx.serial.form` property for removal, issuing release notes, performing community outreach etc.

After a suitable waiting period, the JMX code should be changed to declare serialVersionUID as a constant (`private static final`) using the "new" values, and extraneous fields should be removed. The documentation for the SVUID value can be removed from the javadoc, as the constant SVUID values will be listed automatically on the JDK's Serialized Form page.

See JDK-6253903 for a list of the JMX classes affected.

Comments
Changeset: 3c40afa5 Branch: master Author: Kevin Walls <kevinw@openjdk.org> Date: 2024-09-12 08:31:18 +0000 URL: https://git.openjdk.org/jdk/commit/3c40afa59c93860150960d478a9d2ffe33d4ce32
12-09-2024

These JMX classes are among the few (or possibly only) serializable classes in the JDK for which serialVersionUID is not a static final field, and whose SVUIDs are thus cannot be read statically. Making this change will enable the serialver tool to obtain the SVUIDs of most if not all classes in the JDK without loading and initializing those classes.
10-09-2024

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/20856 Date: 2024-09-04 16:27:51 +0000
05-09-2024

Agreed, this "jmx.serial.form" logic should be removed. It is historic baggage, not something with any expectation of support, or compatibility risk. A CSR and release note really should suffice: it should not need the regular API deprecation process: It is a compatibility courtesy and it is reasonable to remove, now it is around 20 years old. There is no reason for a JMX application running e.g. JDK 24, to be compatible with JMX 1.0 (rather than with 1.1-and-later which was in JDK 5 from September 2004). JMX 1.0 is from before JMX was integrated into the JDK 5. "jmx.serial.form" is not in the JSR 3 or JSR 160 spec pdfs, it's an implementation detail. "jmx.serial.form" affects only classes in java.management.
04-09-2024