On Wed, 15 May 2024 19:09:54 GMT, Chris Plummer <cjplum...@openjdk.org> wrote:

> I'm just trying to understand current and previous behavior of jconsole a bit 
> better.....

Right, to be clear it's not JConsole's fault.   The early part of JConsole's 
stack is:


...connection....
        at 
java.management.rmi/javax.management.remote.rmi.RMIConnectionImpl_Stub.addNotificationListeners(RMIConnectionImpl_Stub.java:136)
        at 
java.management.rmi/javax.management.remote.rmi.RMIConnector.addListenersWithSubjects(RMIConnector.java:595)
        at 
java.management.rmi/javax.management.remote.rmi.RMIConnector.addListenerWithSubject(RMIConnector.java:571)
        at 
java.management.rmi/javax.management.remote.rmi.RMIConnector$RemoteMBeanServerConnection.addNotificationListener(RMIConnector.java:1238)
        at 
jdk.jconsole/sun.tools.jconsole.MBeansTab$1.doInBackground(MBeansTab.java:93)
...older frames...


...and when it is running with an older JDK, 
RMIConnector.addListenerWithSubject() would create a new array of Subjects, 
containing what it was given (which is null).
It passes on the array, and then is going to get the 
UnsupportedOperationException.
i.e. Older client code passing a null Subject, actually "promotes" it to an 
array and hits the Exception, although it really is not trying to use the 
removed feature.

This problem is specifically with addListenerWithSubject.

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

PR Comment: https://git.openjdk.org/jdk/pull/19253#issuecomment-2113397029

Reply via email to