-
Bug
-
Resolution: Done
-
Major
-
2.2.2.Final
-
None
-
-
Workaround Exists
-
-
The GraalVM native image of a project that uses undertow, fails at runtime with following error.
Exception in thread "main" com.oracle.svm.core.jdk.UnsupportedFeatureError: Unsupported method of Unsafe at com.oracle.svm.core.util.VMError.unsupportedFeature(VMError.java:87) at jdk.internal.misc.Unsafe.staticFieldBase(Unsafe.java:236) at sun.misc.Unsafe.staticFieldBase(Unsafe.java:677) at org.jboss.threads.EnhancedQueueExecutor.<clinit>(EnhancedQueueExecutor.java:295) at com.oracle.svm.core.classinitialization.ClassInitializationInfo.invokeClassInitializer(ClassInitializationInfo.java:351) at com.oracle.svm.core.classinitialization.ClassInitializationInfo.initialize(ClassInitializationInfo.java:271) at org.xnio.XnioWorker.<init>(XnioWorker.java:139) at org.xnio.nio.NioXnioWorker.<init>(NioXnioWorker.java:84) at org.xnio.nio.NioXnio.build(NioXnio.java:233) at org.xnio.XnioWorker$Builder.build(XnioWorker.java:1191) at org.xnio.Xnio.createWorker(Xnio.java:481) at org.xnio.Xnio.createWorker(Xnio.java:463) at org.xnio.Xnio.createWorker(Xnio.java:450) at io.undertow.Undertow.start(Undertow.java:122) at com.softinstigate.App.main(App.java:25)
The problem comes from EnhancedQueueExecutor class of jboss-threads Here the static class initializer of EnhancedQueueExecutor fails on this line:
static volatile int sequence = 1; ... sequence = unsafe.staticFieldBase(EnhancedQueueExecutor.class.getDeclaredField("sequence"));