Open jchrisos opened 5 years ago
I fixed this by adding this argument to native-image: --initialize-at-build-time=io.ktor,kotlinx,kotlin,org.slf4j
Not sure if all of those are strictly necessary of if they can be made more specific but it worked for me
Hi,
I'm trying to run gradle and maven examples and I'm getting an exception
Thank you,
Steps Maven:
Steps gradle:
My setup: OS: Ubuntu 18.04 LTS Java: 1.8.0_212
I tested in macos 10.14 and got same exception.
Exception in thread "DefaultDispatcher-worker-3" java.lang.ExceptionInInitializerError at com.oracle.svm.core.hub.ClassInitializationInfo.initialize(ClassInitializationInfo.java:287) at java.lang.Class.ensureInitialized(DynamicHub.java:437) at io.ktor.network.selector.SelectableBase.<init>(Selectable.kt:38) at io.ktor.network.sockets.ServerSocketImpl.<init>(ServerSocketImpl.kt:11) at io.ktor.network.sockets.TcpSocketBuilder.bind(Builders.kt:122) at io.ktor.network.sockets.TcpSocketBuilder.bind$default(Builders.kt:114) at io.ktor.server.cio.HttpServerKt$httpServer$acceptJob$1.invokeSuspend(HttpServer.kt:88) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:32) at kotlinx.coroutines.DispatchedTask.run(Dispatched.kt:233) at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:594) at kotlinx.coroutines.scheduling.CoroutineScheduler.access$runSafely(CoroutineScheduler.kt:60) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:742) at com.oracle.svm.core.thread.JavaThreads.threadStartRoutine(JavaThreads.java:473) at com.oracle.svm.core.posix.thread.PosixJavaThreads.pthreadStartRoutine(PosixJavaThreads.java:193) Caused by: java.lang.RuntimeException: java.lang.NoSuchFieldException: readHandlerReference at java.util.concurrent.atomic.AtomicReferenceFieldUpdater$AtomicReferenceFieldUpdaterImpl.<init>(AtomicReferenceFieldUpdater.java:162) at java.util.concurrent.atomic.AtomicReferenceFieldUpdater.newUpdater(AtomicReferenceFieldUpdater.java:110) at io.ktor.network.selector.InterestSuspensionsMap.<clinit>(InterestSuspensionsMap.kt:61) at com.oracle.svm.core.hub.ClassInitializationInfo.invokeClassInitializer(ClassInitializationInfo.java:347) at com.oracle.svm.core.hub.ClassInitializationInfo.initialize(ClassInitializationInfo.java:267) ... 13 more Caused by: java.lang.NoSuchFieldException: readHandlerReference at java.lang.Class.getDeclaredField(DynamicHub.java:2070) at java.util.concurrent.atomic.AtomicReferenceFieldUpdater$AtomicReferenceFieldUpdaterImpl.<init>(AtomicReferenceFieldUpdater.java:157) ... 17 more