{"record":{"id":"23e0cc6b2bb76e09","repo":"pinpoint-apm/pinpoint","slug":"operatingsystemmxbean-not-available","errorCode":null,"errorMessage":"OperatingSystemMXBean not available","messagePattern":"OperatingSystemMXBean not available","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"agent-module/profiler-optional/profiler-optional-jdk8/src/main/java/com/navercorp/pinpoint/profiler/monitor/metric/cpu/ibm/DefaultCpuLoadMetric.java","lineNumber":41,"sourceCode":"import org.apache.logging.log4j.LogManager;\nimport org.apache.logging.log4j.Logger;\n\nimport java.lang.management.ManagementFactory;\n\n/**\n * @author HyunGil Jeong\n */\npublic class DefaultCpuLoadMetric implements CpuLoadMetric {\n\n    private final Logger logger = LogManager.getLogger(this.getClass());\n\n    private final CpuUsageProvider jvmCpuUsageProvider;\n    private final CpuUsageProvider systemCpuUsageProvider;\n\n    public DefaultCpuLoadMetric() {\n        final OperatingSystemMXBean operatingSystemMXBean = (com.ibm.lang.management.OperatingSystemMXBean) ManagementFactory.getOperatingSystemMXBean();\n        if (operatingSystemMXBean == null) {\n            throw new IllegalStateException(\"OperatingSystemMXBean not available\");\n        }\n\n        CpuUsageProvider jvmCpuUsageProvider = new JvmCpuUsageProvider(operatingSystemMXBean);\n        try {\n            jvmCpuUsageProvider.getCpuUsage();\n        } catch (NoSuchMethodError e) {\n            logger.warn(\"Expected method not found for retrieving jvm cpu usage. Cause : {}\", e.getMessage());\n            jvmCpuUsageProvider = CpuUsageProvider.UNSUPPORTED;\n        }\n        this.jvmCpuUsageProvider = jvmCpuUsageProvider;\n\n        CpuUsageProvider systemCpuUsageProvider = new SystemCpuUsageProvider(operatingSystemMXBean);\n        try {\n            systemCpuUsageProvider.getCpuUsage();\n        } catch (NoSuchMethodError e) {\n            logger.warn(\"Expected method not found for retrieving system cpu usage. Cause : {}\", e.getMessage());\n            systemCpuUsageProvider = CpuUsageProvider.UNSUPPORTED;\n        }","sourceCodeStart":23,"sourceCodeEnd":59,"githubUrl":"https://github.com/pinpoint-apm/pinpoint/blob/744c3d3075e595656abb1ae331ad2c0e4c9eb996/agent-module/profiler-optional/profiler-optional-jdk8/src/main/java/com/navercorp/pinpoint/profiler/monitor/metric/cpu/ibm/DefaultCpuLoadMetric.java#L23-L59","documentation":"DefaultCpuLoadMetric for IBM JDKs casts the platform OperatingSystemMXBean to com.ibm.lang.management.OperatingSystemMXBean and fails fast with IllegalStateException when the bean is null. This indicates the agent is not running on an IBM J9/JDK8 JVM exposing the IBM-specific MXBean, so JVM CPU-load metrics cannot be collected.","triggerScenarios":"Constructing com.navercorp.pinpoint.profiler.monitor.metric.cpu.ibm.DefaultCpuLoadMetric when ManagementFactory.getOperatingSystemMXBean() returns null or cannot be cast to the IBM OperatingSystemMXBean interface (non-IBM JVM, or IBM JDK missing the management API).","commonSituations":"Running the pinpoint agent on HotSpot/OpenJDK while the IBM profiler-optional-jdk8 plugin is loaded; using a stripped-down or custom JVM without the IBM management extensions; misconfigured JVM vendor detection selecting the wrong CPU metric module.","solutions":["Run the agent on an IBM JDK8 so com.ibm.lang.management.OperatingSystemMXBean is present","Disable/exclude the IBM CpuLoadMetric plugin if not on IBM JDK","Verify vendor detection selects the correct DefaultCpuLoadMetric for your JVM","Update Pinpoint so JVM vendor detection handles your JDK properly"],"exampleFix":"// before: forcing IBM metric on wrong JVM\nnew DefaultCpuLoadMetric(); // throws IllegalStateException\n// after: pick metric by JVM vendor\nCpuLoadMetric metric = JvmUtils.supportsIbmMXBean() ? new DefaultCpuLoadMetric() : new UnsupportedCpuLoadMetric();","handlingStrategy":"validation","validationCode":"Object bean = ManagementFactory.getOperatingSystemMXBean();\nboolean ibmOk = bean instanceof com.ibm.lang.management.OperatingSystemMXBean;","typeGuard":"boolean isIbmOperatingSystemMXBean(OperatingSystemMXBean b) {\n    return b instanceof com.ibm.lang.management.OperatingSystemMXBean;\n}","tryCatchPattern":null,"preventionTips":["Confirm JVM vendor before enabling IBM metric plugins","Gate plugin loading on bean instanceof checks","Keep vendor detection in Pinpoint up to date"],"tags":["jmx","jvm","ibm","cpu-metrics"],"backgroundTag":"unsupported-platform","analyzedSha":"744c3d3075e595656abb1ae331ad2c0e4c9eb996","analyzedAt":"2026-09-07T18:48:45.289Z","contentChangedAt":"2026-09-07T18:48:45.289Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}