JDK-6933325 : Return proper impact code on built-in MBean operations (not ACTION_INFO)
  • Type: Bug
  • Component: core-svc
  • Sub-Component: java.lang.management
  • Affected Version: 6
  • Priority: P5
  • Status: Open
  • Resolution: Unresolved
  • OS: generic
  • CPU: generic
  • Submitted: 2010-03-09
  • Updated: 2022-02-04
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.
Other
tbdUnresolved
Description
FULL PRODUCT VERSION :
All tested versions of Java SE 1.5/5.0 and 1.6/6.0.

ADDITIONAL OS VERSION INFORMATION :
N/A (platform generic)

A DESCRIPTION OF THE PROBLEM :
As visible through JConsole or other direct API usage, all operations exposed through the built-in MBeans under "java.lang" and "java.util.logging" report an "Impact" of "ACTION_INFO".  This is not always correct.

A current list of affected operations from 1.6.0_18-b07:

java.lang:type=Threading / sun.management.ThreadImpl
  - getThreadCpuTime(...)
  - getThreadInfo(...)
  - getThreadUserTime(...)
java.util.logging:type=Logging / java.util.logging.Logging
  - getLoggerLevel(...)
  - getParentLoggerName(...)

All the above operations return an "Impact" of "ACTION_INFO", but "INFO" would be most correct.  Even "UNKNOWN" would be better than the current.

I am working on an authorization implementation to control access to JMX calls.  One of the options allows access to "read-only" methods/operations, as determined by MBeanOperationInfo.getImpact().  Due to the "ACTION_INFO" being returned by the above operations, these operations are being improperly denied access.  In JConsole, this results in the Threads graphs and tab being unavailable.

It is not clear how the MBeanInfo is being created for these beans / operations.  However, other beans created with StandardMBean properly default to "UNKNOWN", and properly return other values as/if specified.

Another example of an exposed bean that returns a proper "UNKNOWN" impact is getVMOption(...) on com.sun.management:type=HotSpotDiagnostic / sun.management.HotSpotDiagnostic .

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Above referenced MBean operations should return "INFO" instead of "ACTION_INFO".

REPRODUCIBILITY :
This bug can be reproduced always.

Comments
In JDK 9 Impact value is UNKNOWN by default for operations mentioned in the description java.lang:type=Threading / sun.management.ThreadImpl - getThreadCpuTime(...) - getThreadInfo(...) - getThreadUserTime(...) java.util.logging:type=Logging / java.util.logging.Logging - getLoggerLevel(...) - getParentLoggerName(...) impact value should be changed to one of INFO, ACTION, ACTION_INFO or UNKNOWN as applicable to corresponding operation
14-02-2017

EVALUATION The annotations from the JMX 2.0 API should make this simple, but that's not available yet. We could have some internal version of that for the built-in MBeans, or some programmatic way of setting the impact.
09-03-2010