pinpoint-apm/pinpoint · warning

Expected method not found for retrieving jvm cpu usage. Caus

Error message

Expected method not found for retrieving jvm cpu usage. Cause : {}

What it means

DefaultCpuLoadMetric (IBM JVM variant) probes the OperatingSystemMXBean at construction by calling jvmCpuUsageProvider.getCpuUsage() once. If an IBM-specific method is missing on the current JVM, NoSuchMethodError is caught, a warning 'Expected method not found for retrieving jvm cpu usage' is logged, and the provider is downgraded to CpuUsageProvider.UNSUPPORTED so JVM CPU metrics return null instead of crashing.

Source

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

 */
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;
        }
        this.systemCpuUsageProvider = systemCpuUsageProvider;
    }

    @Override
    public CpuLoadMetricSnapshot getSnapshot() {
        double jvmCpuUsage = jvmCpuUsageProvider.getCpuUsage();
        double systemCpuUsage = systemCpuUsageProvider.getCpuUsage();

View on GitHub (pinned to 744c3d3075)

Solutions

  1. Run on the JVM family the metric class targets (IBM JRE for the ibm package)
  2. Verify IBM JRE version supports the probed OperatingSystemMXBean methods (IBM 7.0.1+/8+)
  3. Ignore the warning if only system CPU metrics are needed — jvm CPU will be reported as unsupported
  4. Check the profiler-optional-jdk8 module is compatible with the runtime JVM vendor

Example fix

// before (forcing IBM metrics on HotSpot)
metricRegistry.register("jvm.cpu", new com.navercorp.pinpoint.profiler.monitor.metric.cpu.ibm.DefaultCpuLoadMetric(osBean));
// after (let Pinpoint select by JVM vendor)
CpuLoadMetricGetter getter = CpuLoadMetricSelector.getCpuLoadMetricGetter(); // returns oracle/ibm variant appropriately
Defensive patterns

Strategy: fallback

Validate before calling

java.lang.management.OperatingSystemMXBean bean = ManagementFactory.getOperatingSystemMXBean(); boolean isIbm = bean instanceof com.ibm.lang.management.OperatingSystemMXBean; if (!isIbm) use oracle/standard variant;

Type guard

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

Try / catch

try { provider.getCpuUsage(); } catch (NoSuchMethodError e) { provider = CpuUsageProvider.UNSUPPORTED; } // built-in: metrics degrade to null

Prevention

When it happens

Trigger: Constructing DefaultCpuLoadMetric on a JVM whose com.ibm.lang.management.OperatingSystemMXBean lacks the expected processCpuLoad-style method — i.e. non-IBM JRE or an IBM JRE version older than the probed API.

Common situations: Running the profiler on OpenJDK/HotSpot while the ibm metric package was loaded; old IBM Java 7/8 builds without the CPU load methods; shaded/wrong MXBean class on the classpath.

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/0d47528ba70292c4. Report an issue: GitHub.