Review Request: JMC-5893: Commercial features check removed in JDK 11

Sharath Ballal sharath.ballal at oracle.com
Mon May 28 10:03:08 UTC 2018


Erik,

Modified webrev is at http://cr.openjdk.java.net/~sballal/JMC-5893/webrev.01/ 


Thanks,
Sharath


-----Original Message-----
From: Sharath Ballal 
Sent: Saturday, May 26, 2018 11:30 PM
To: Erik Gahlin
Cc: jmc-dev at openjdk.java.net
Subject: RE: Review Request: JMC-5893: Commercial features check removed in JDK 11

Thanks Erik, I will make the changes and send new webrev.


Thanks,
Sharath


-----Original Message-----
From: Erik Gahlin
Sent: Saturday, May 26, 2018 11:26 PM
To: Sharath Ballal
Cc: jmc-dev at openjdk.java.net
Subject: Re: Review Request: JMC-5893: Commercial features check removed in JDK 11

Hi Sharath, 

> On 26 May 2018, at 14:33, Sharath Ballal <sharath.ballal at oracle.com> wrote:
> 
> Hi Erik,
> 
> Thanks for the review.
> 
> I had checked this, but not sure how I missed it.  Now I put some prints and verified that for JDK 9, 10 and 11 the ObjectName for JFR is "jdk.management.jfr:type=FlightRecorder".
> For 8 & 7 I verified from code that the name is  "com.oracle.jrockit:type=FlightRecorder" but I when I use it I get a InstanceNotFoundException.  Am I missing anything?

Yes, the MBean needs to be registered in the platform MBeanServer, which can be done using the MissionControlMXBean, which existed in Oracle JDK, but was removed with JDK 9 when the MBean was rewritten into a supported API.


> (Actually if I check only for jdk.management.jfr:type=FlightRecorder
> it is enough since we only want this check to work in 11)

It should be sufficient.

>From JDK 9, a user can create their own modular runtime image using the jlink tool, so jdk.management.jfr may not be present even in a JDK 11 image.

I think it would be best not to mention the JDK version in the source code, and just focus on if the capability is present or not.

Thanks
Erik
 

> 
> javax.management.InstanceNotFoundException: com.oracle.jrockit:type=FlightRecorder
> 	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getMBean(DefaultMBeanServerInterceptor.java:1095)
> 	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getMBeanInfo(DefaultMBeanServerInterceptor.java:1375)
> 	...
> 	...
> 
> Thanks,
> Sharath
> 
> 
> -----Original Message-----
> From: Erik Gahlin
> Sent: Friday, May 25, 2018 3:16 PM
> To: jmc-dev at openjdk.java.net
> Subject: Re: Review Request: JMC-5893: Commercial features check 
> removed in JDK 11
> 
> Hi Sharath,
> 
> As far as I know, the ObjectName for JFR has always been "jdk.management.jfr:type=FlightRecorder" for JDK 9, 10 and 11. For JDK 5, 6, 7 and 8, the name was "com.oracle.jrockit:type=FlightRecorder".
> 
> If this is incorrect, we have a terrible bug that has gone unnoticed.
> 
> Erik
> 
>> Please review the fix for:
>> 
>> 
>> 
>> JBS: https://bugs.openjdk.java.net/browse/JMC-5893
>> 
>> 
>> 
>> Webrev: http://cr.openjdk.java.net/~sballal/JMC-5893/webrev.00/
>> 
>> 
>> 
>> Following is the description of the testing done and result:
>> 
>> 
>> 
>> Ran mvn verify successfully.
>> 
>> OpenJDK 11 - Does not show "Commercial feature" dialog box.  
>> Recording can be done, but cannot be loaded due to JMC-5895
>> 
>> OracleJDK 11 - Shows "Commercial feature" dialog box as 
>> "UnlockCommercialFeatures" flag is still present.  Recording can be 
>> done, but cannot be loaded due to JMC-5895
>> 
>> OpenJDK 10 (10.0.1) - Fails with message "Flight Recorder features are not enabled"
>> 
>> OracleJDK 10 (10.0.1) - Shows "Commercial feature" dialog box. Recording can be done and gets loaded.
>> 
>> OpenJDK 9 (9.0.4.1-ojdkbuild) - Fails with message "Flight Recorder features are not enabled"
>> 
>> OracleJDK 9 (9.0.4)- Shows "Commercial feature" dialog box. Recording can be done and gets loaded.
>> 
>> OpenJDK 8 (1.8.0_91-3-ojdkbuild) - Fails with message "Flight Recorder features are not enabled"
>> 
>> OracleJDK 8 (1.8.0_161) - Shows "Commercial feature" dialog box. Recording can be done and gets loaded.
>> 
>> OpenJDK 7 (1.7.0-u80-unofficial) - Fails with message Flight Recorder 
>> is not supported below 7U4. (same message without fix from a 
>> standalone client)
>> 
>> OracleJDK 7 (1.7.0_80) - Recording can be done and gets loaded (need to explicitly provide the UnlockCommercialFeatures and FlightRecorder options).
>> 
>> 
>> 
>> Thanks,
>> 
>> Sharath
>> 
>> 
>> 
>> 
> 



More information about the jmc-dev mailing list