I'm not sure if this is a gradle or a ktor or a mu...
# gradle
t
I'm not sure if this is a gradle or a ktor or a multiplatform problem but I'm having trouble with dependency management. I have no idea how to go on with this. The dependencies are clearly there... What makes thing worse is that I have another project in this repo which have a test case for this exact setup and that can find the Netty class. Gradle: 8.7 KMP: 2.0
Copy code
jvmMain {
            dependencies {
                implementation(libs.adaptive.lib.exposed)
                implementation(libs.ktor.server.core)
                implementation(libs.ktor.server.netty)
                implementation(libs.ktor.server.websockets)
            }
        }
Copy code
Exception in thread "DefaultDispatcher-worker-2" java.lang.NoClassDefFoundError: io/ktor/server/netty/Netty
	at hu.simplexion.adaptive.ktor.worker.KtorWorker.run(KtorWorker.kt:30)
	at hu.simplexion.adaptive.server.builtin.ServerWorker$mount$2$1.invokeSuspend(ServerWorker.kt:41)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)
	Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@4d26b1b, Dispatchers.Default]
Caused by: java.lang.ClassNotFoundException: io.ktor.server.netty.Netty
	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:526)
	... 8 more
c
Can you check if the dependency is actually added? You should be able to view dependencies with the
dependencyInsights
task or through a build scan
t
Thanks for the reply. I couldn't run any of these without errors. At the end the multiplatform JS + gradle drove me mad and I decided to drop the whole issue and reorganize this part to another subproject where it works for some unfathomable reason. This is a composite project with multiple composite subprojects and multiplatform sometimes can do strange things.