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
- 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
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
- Confirm JVM vendor before enabling IBM metric plugins
- Gate plugin loading on bean instanceof checks
- Keep vendor detection in Pinpoint up to date
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
- OperatingSystemMXBean not available
- Expected method not found for retrieving jvm cpu usage. Caus
- Expected method not found for retrieving system cpu usage. C
- Expected method not found for retrieving jvm cpu usage. Caus
- Expected method not found for retrieving system cpu usage. C
AI-assisted analysis of pinpoint-apm/pinpoint@744c3d3075 (2026-09-07).
Data as JSON: /api/errors/23e0cc6b2bb76e09.
Report an issue: GitHub.