pinpoint-apm/pinpoint · error · IllegalStateException

OperatingSystemMXBean not available

Error message

OperatingSystemMXBean not available

What it means

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.

Source

Thrown at agent-module/profiler-optional/profiler-optional-jdk8/src/main/java/com/navercorp/pinpoint/profiler/monitor/metric/cpu/ibm/DefaultCpuLoadMetric.java:41

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import java.lang.management.ManagementFactory;

/**
 * @author HyunGil Jeong
 */
public class DefaultCpuLoadMetric implements CpuLoadMetric {

    private final Logger logger = LogManager.getLogger(this.getClass());

    private final CpuUsageProvider jvmCpuUsageProvider;
    private final CpuUsageProvider systemCpuUsageProvider;

    public DefaultCpuLoadMetric() {
        final OperatingSystemMXBean operatingSystemMXBean = (com.ibm.lang.management.OperatingSystemMXBean) ManagementFactory.getOperatingSystemMXBean();
        if (operatingSystemMXBean == null) {
            throw new IllegalStateException("OperatingSystemMXBean not available");
        }

        CpuUsageProvider jvmCpuUsageProvider = new JvmCpuUsageProvider(operatingSystemMXBean);
        try {
            jvmCpuUsageProvider.getCpuUsage();
        } catch (NoSuchMethodError e) {
            logger.warn("Expected method not found for retrieving jvm cpu usage. Cause : {}", e.getMessage());
            jvmCpuUsageProvider = CpuUsageProvider.UNSUPPORTED;
        }
        this.jvmCpuUsageProvider = jvmCpuUsageProvider;

        CpuUsageProvider systemCpuUsageProvider = new SystemCpuUsageProvider(operatingSystemMXBean);
        try {
            systemCpuUsageProvider.getCpuUsage();
        } catch (NoSuchMethodError e) {
            logger.warn("Expected method not found for retrieving system cpu usage. Cause : {}", e.getMessage());
            systemCpuUsageProvider = CpuUsageProvider.UNSUPPORTED;
        }

View on GitHub (pinned to 744c3d3075)

Solutions

  1. Run the agent on an IBM JDK8 so com.ibm.lang.management.OperatingSystemMXBean is present
  2. Disable/exclude the IBM CpuLoadMetric plugin if not on IBM JDK
  3. Verify vendor detection selects the correct DefaultCpuLoadMetric for your JVM
  4. Update Pinpoint so JVM vendor detection handles your JDK properly

Example fix

// before: forcing IBM metric on wrong JVM
new DefaultCpuLoadMetric(); // throws IllegalStateException
// after: pick metric by JVM vendor
CpuLoadMetric metric = JvmUtils.supportsIbmMXBean() ? new DefaultCpuLoadMetric() : new UnsupportedCpuLoadMetric();
Defensive patterns

Strategy: validation

Validate before calling

Object bean = ManagementFactory.getOperatingSystemMXBean();
boolean ibmOk = bean instanceof com.ibm.lang.management.OperatingSystemMXBean;

Type guard

boolean isIbmOperatingSystemMXBean(OperatingSystemMXBean b) {
    return b instanceof com.ibm.lang.management.OperatingSystemMXBean;
}

Prevention

When it happens

Trigger: 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).

Common situations: 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.

Understand the failure class

Background: "unsupported platform" / "not supported on this platform" errors: what they mean and how to fix them — this error's family across 47 libraries.

Related errors


AI-assisted analysis of pinpoint-apm/pinpoint@744c3d3075 (2026-09-07). Data as JSON: /api/errors/23e0cc6b2bb76e09. Report an issue: GitHub.