{"record":{"id":"2ac88156ab230f7f","repo":"pinpoint-apm/pinpoint","slug":"expected-method-not-found-for-retrieving-system-cp","errorCode":null,"errorMessage":"Expected method not found for retrieving system cpu usage. Cause : {}","messagePattern":"Expected method not found for retrieving system cpu usage\\. Cause : (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"agent-module/profiler-optional/profiler-optional-jdk8/src/main/java/com/navercorp/pinpoint/profiler/monitor/metric/cpu/ibm/DefaultCpuLoadMetric.java","lineNumber":57,"sourceCode":"        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        }\n        this.systemCpuUsageProvider = systemCpuUsageProvider;\n    }\n\n    @Override\n    public CpuLoadMetricSnapshot getSnapshot() {\n        double jvmCpuUsage = jvmCpuUsageProvider.getCpuUsage();\n        double systemCpuUsage = systemCpuUsageProvider.getCpuUsage();\n        return new CpuLoadMetricSnapshot(jvmCpuUsage, systemCpuUsage);\n    }\n\n    @Override\n    public String toString() {\n        return \"CpuLoadMetric for IBM Java 1.7+\";\n    }\n\n    private static class JvmCpuUsageProvider implements CpuUsageProvider {","sourceCodeStart":39,"sourceCodeEnd":75,"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#L39-L75","documentation":"Same probe pattern as the JVM CPU provider, but for the system-wide CPU usage provider in DefaultCpuLoadMetric (IBM variant). If the OperatingSystemMXBean lacks the expected system CPU method, NoSuchMethodError is caught and 'Expected method not found for retrieving system cpu usage' is logged; the provider becomes CpuUsageProvider.UNSUPPORTED and system CPU metrics report null.","triggerScenarios":"Constructing DefaultCpuLoadMetric on a JVM without the IBM-specific OperatingSystemMXBean.getSystemCpuLoad-style method — non-IBM JRE or an older IBM JRE lacking that API.","commonSituations":"HotSpot/OpenJDK runtime loading the IBM metric implementation; IBM JRE versions without getSystemCpuLoad; classpath shipping the wrong MXBean interface.","solutions":["Run on the intended IBM JRE or use the Oracle/HotSpot metric variant","Upgrade the IBM JRE to a version exposing the system CPU load MXBean methods","Treat the warning as informational — system CPU metric will simply be unsupported","Confirm the correct profiler-optional module matches the runtime vendor"],"exampleFix":"// before\nnew DefaultCpuLoadMetric(com.sun.management.OperatingSystemMXBean) // wrong bean on IBM JRE\n// after\ncom.ibm.lang.management.OperatingSystemMXBean bean = (com.ibm.lang.management.OperatingSystemMXBean) ManagementFactory.getOperatingSystemMXBean();\nnew DefaultCpuLoadMetric(bean);","handlingStrategy":"fallback","validationCode":"com.ibm.lang.management.OperatingSystemMXBean ibmBean = (bean instanceof com.ibm.lang.management.OperatingSystemMXBean) ? (com.ibm.lang.management.OperatingSystemMXBean) bean : null; if (ibmBean == null) skip system cpu provider setup;","typeGuard":null,"tryCatchPattern":"try { systemProvider.getCpuUsage(); } catch (NoSuchMethodError e) { systemProvider = CpuUsageProvider.UNSUPPORTED; }","preventionTips":["Use the JVM-vendor-correct DefaultCpuLoadMetric implementation","Upgrade IBM JRE if getSystemCpuLoad is missing","Cast the platform MXBean to the vendor interface before probing","Accept UNSUPPORTED degradation rather than disabling CPU metrics entirely"],"tags":["jvm","monitoring","cpu-metrics","ibm","nosuchmethod"],"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"}