Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8326691

Remove the implementation of JMX Subject Delegation and degrade the applicable APIs to throw UnsupportedOperationException



    • CSR
    • Resolution: Approved
    • P3
    • 23
    • core-svc
    • None
    • behavioral
    • medium
    • Removal of Subject Delegation. The removal has no impact on users of other JMX features, the JDK's built-in instrumentation, or any of the observability tools.
    • Java API
    • SE



      Remove Java Management Extension (JMX) Subject Delegation which was deprecated for removal in Java 21. The feature is directly dependent on Security Manager APIs that are deprecated for removal. The Subject Delegation feature will cease to be usable once the Security Manager APIs are further degraded and the Security Manager implementation is removed.


      This feature has no known current usage.

      This feature does not work without support for the Security Manager APIs which are deprecated for removal (since Java 17, see JEP 411).


      We will remove the feature. There is no replacement. For source and binary compatibility reasons the relevant method is not being removed at this time, but will throw an UnsupportedOperationException when Subject Delegation is attempted.


      The method javax.management.remote.JMXConnector.getMBeanServerConnection(Subject delegationSubject) will throw an UnsupportedOperationException if a non-null delegation subject is provided. This method's documentation will be updated:

      @param delegationSubject must be null.
      @exception UnsupportedOperationException if delegationSubject is non-null.

      The class javax.management.remote.rmi.RMIConnection will document at the class level that: "JMX Subject Delegation has been removed. All methods that take a delegationSubject parameter will throw UnsupportedOperationException if it is non-null. This parameter is kept for interoperability with older remote clients."

      All methods in RMIConnection which take a delegationSubject will be updated with:

       @param delegationSubject must be null.
       @throws UnsupportedOperationException if delegationSubject is non-null.

      The class javax.management.remote.rmi.RMIConnectionImpl has methods which accept a Subject parameter for Subject Delegation. This cannot now be non-null in local usage, but an RMI Connection from an older JDK can invoke these methods with a non-null delegationSubject. Such access will be recognised and an UnsupportedOperationException will be thrown.

      The attached JMX_SubjectDelegation_Removal_specdiff.zip shows the above in detail (see the files JMXConnector.html, RMIConnector.html, RMIConnection.html, RMIConnectionImpl.html).

      PR: https://github.com/openjdk/jdk/pull/18025


        Issue Links



              kevinw Kevin Walls
              kevinw Kevin Walls
              Daniel Fuchs, Mandy Chung, Sean Mullan
              0 Vote for this issue
              4 Start watching this issue