-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Open
Labels
Description
Describe the Issue
This was originally reported as a Spring Boot issue, but it fails with a plain Java application:
package com.example.demo;
import java.lang.management.ManagementFactory;
import jdk.management.VirtualThreadSchedulerMXBean;
public class DemoApplication {
public static void main(String[] args) {
System.out.println(ManagementFactory.getPlatformMXBean(VirtualThreadSchedulerMXBean.class));
}
}Using the latest version of GraalVM can resolve many issues.
- I tried with the latest version of GraalVM.
GraalVM Version
java version "25.0.1" 2025-10-21 LTS
Java(TM) SE Runtime Environment Oracle GraalVM 25.0.1+8.1 (build 25.0.1+8-LTS-jvmci-b01)
Java HotSpot(TM) 64-Bit Server VM Oracle GraalVM 25.0.1+8.1 (build 25.0.1+8-LTS-jvmci-b01, mixed mode, sharing)
Operating System and Version
macOS 15.7.3
Troubleshooting Confirmation
- I tried the suggestions in the troubleshooting guide.
Run Command
./demo
Expected Behavior
VirtualThreadSchedulerMXBean can be retrieved from the management factory.
Actual Behavior
Exception in thread "main" java.lang.IllegalArgumentException: jdk.management.VirtualThreadSchedulerMXBean is not a platform management interface
at org.graalvm.nativeimage.builder/com.oracle.svm.core.jdk.management.ManagementSupport.getPlatformMXBean(ManagementSupport.java:142)
at java.management@25.0.1/java.lang.management.ManagementFactory.getPlatformMXBean(ManagementFactory.java:56)
at com.example.demo.DemoApplication.main(DemoApplication.java:9)
at java.base@25.0.1/java.lang.invoke.LambdaForm$DMH/sa346b79c.invokeStaticInit(LambdaForm$DMH)
Steps to Reproduce
Compile the above minimal application as a native image and run it.
Additional Context
No response
Run-Time Log Output and Error Messages
Exception in thread "main" java.lang.IllegalArgumentException: jdk.management.VirtualThreadSchedulerMXBean is not a platform management interface
at org.graalvm.nativeimage.builder/com.oracle.svm.core.jdk.management.ManagementSupport.getPlatformMXBean(ManagementSupport.java:142)
at java.management@25.0.1/java.lang.management.ManagementFactory.getPlatformMXBean(ManagementFactory.java:56)
at com.example.demo.DemoApplication.main(DemoApplication.java:9)
at java.base@25.0.1/java.lang.invoke.LambdaForm$DMH/sa346b79c.invokeStaticInit(LambdaForm$DMH)
ThomasVitale