K
Kord4w ago
Joker

Error after adding kord dependency

After I added kord to my backend project it throws this error:
Exception in thread "main" java.lang.NoClassDefFoundError: io/ktor/client/plugins/contentnegotiation/ContentNegotiation
at com.skyrealm.networking.pelican.http.ConnectionBuilder.build$lambda$4(ConnectionBuilder.kt:26)
at io.ktor.client.HttpClientKt.HttpClient(HttpClient.kt:42)
at com.skyrealm.networking.pelican.http.ConnectionBuilder.build(ConnectionBuilder.kt:25)
at com.skyrealm.networking.pelican.http.ConnectionBuilder.<init>(ConnectionBuilder.kt:22)
at com.skyrealm.networking.pelican.PelicanHandler.<init>(PelicanHandler.kt:27)
at com.skyrealm.backend.Controller.start(Controller.kt:45)
at com.skyrealm.backend.MainKt.main(Main.kt:4)
at com.skyrealm.backend.MainKt$main$2.invoke(Main.kt)
at com.skyrealm.backend.MainKt$main$2.invoke(Main.kt)
at kotlin.coroutines.intrinsics.IntrinsicsKt__IntrinsicsJvmKt$createCoroutineUnintercepted$$inlined$createCoroutineFromSuspendFunction$IntrinsicsKt__IntrinsicsJvmKt$1.invokeSuspend(IntrinsicsJvm.kt:223)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlin.coroutines.ContinuationKt.startCoroutine(Continuation.kt:115)
at kotlin.coroutines.jvm.internal.RunSuspendKt.runSuspend(RunSuspend.kt:19)
at com.skyrealm.backend.MainKt.main(Main.kt)
Caused by: java.lang.ClassNotFoundException: io.ktor.client.plugins.contentnegotiation.ContentNegotiation
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:528)
... 14 more
Exception in thread "main" java.lang.NoClassDefFoundError: io/ktor/client/plugins/contentnegotiation/ContentNegotiation
at com.skyrealm.networking.pelican.http.ConnectionBuilder.build$lambda$4(ConnectionBuilder.kt:26)
at io.ktor.client.HttpClientKt.HttpClient(HttpClient.kt:42)
at com.skyrealm.networking.pelican.http.ConnectionBuilder.build(ConnectionBuilder.kt:25)
at com.skyrealm.networking.pelican.http.ConnectionBuilder.<init>(ConnectionBuilder.kt:22)
at com.skyrealm.networking.pelican.PelicanHandler.<init>(PelicanHandler.kt:27)
at com.skyrealm.backend.Controller.start(Controller.kt:45)
at com.skyrealm.backend.MainKt.main(Main.kt:4)
at com.skyrealm.backend.MainKt$main$2.invoke(Main.kt)
at com.skyrealm.backend.MainKt$main$2.invoke(Main.kt)
at kotlin.coroutines.intrinsics.IntrinsicsKt__IntrinsicsJvmKt$createCoroutineUnintercepted$$inlined$createCoroutineFromSuspendFunction$IntrinsicsKt__IntrinsicsJvmKt$1.invokeSuspend(IntrinsicsJvm.kt:223)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlin.coroutines.ContinuationKt.startCoroutine(Continuation.kt:115)
at kotlin.coroutines.jvm.internal.RunSuspendKt.runSuspend(RunSuspend.kt:19)
at com.skyrealm.backend.MainKt.main(Main.kt)
Caused by: java.lang.ClassNotFoundException: io.ktor.client.plugins.contentnegotiation.ContentNegotiation
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:528)
... 14 more
` Version: 0.15.0
Solution:
you're using a different version of ktor to the one kord uses
Jump to solution
4 Replies
Joker
JokerOP4w ago
I already have the ktor client dependency installed for other api fetches, but the error only occurs on startup when kord is installed
Solution
gdude
gdude4w ago
you're using a different version of ktor to the one kord uses
gdude
gdude4w ago
that's the problem
Joker
JokerOP4w ago
yeah you are right

Did you find this page helpful?