Hi, I hope this error makes sense to someone, beca...
# server
l
Hi, I hope this error makes sense to someone, because it’s got me stumped.
Copy code
Exception in thread "main" java.lang.NoSuchMethodError: 'kotlinx.io.files.Path kotlinx.io.files.FileSystem.resolve(kotlinx.io.files.Path)'
	at io.ktor.server.engine.ServerEngineUtilsKt.<clinit>(ServerEngineUtils.kt:9)
	at io.ktor.server.engine.EmbeddedServerKt.embeddedServer$default(EmbeddedServer.kt:73)
	at com.greymatter.sfad.ApplicationKt.main(Application.kt:9)
	at com.greymatter.sfad.ApplicationKt.main(Application.kt)
Copy code
package com.greymatter.sfad

import com.greymatter.sfad.plugins.*
import io.ktor.server.application.*
import io.ktor.server.engine.*
import io.ktor.server.netty.*

fun main() {
    embeddedServer(Netty, port = 8080, host = "0.0.0.0", module = Application::module)  // line 9
        .start(wait = true)
}

fun Application.module() {
    configureSecurity()
    configureHTTP()
    configureMonitoring()
    configureSerialization()
    configureDatabases()
    configureSockets()
    configureAdministration()
    configureRouting()
}
It might help to know that this is a multi-rooted project that began as a Multiplatform project, and I just decided to switch the backend to Ktor and the frontend to KMP Web, so the whole thing is in flux. This could be related to something I’ve done wrong in one of the build.gradle.kts files. Any clues would be greatly appreciated.
m
Looks like a classpath issue. Make sure kotlinx-io is in your runtime classpath (and also double check the version?)
l
I generated a project at https://start.ktor.io, and even it won’t run.
Copy code
% ./gradlew run

> Task :run FAILED
Exception in thread "main" java.lang.NoSuchMethodError: 'io.ktor.server.config.ApplicationConfig io.ktor.server.config.ConfigLoader$Companion.load$default(io.ktor.server.config.ConfigLoader$Companion, java.lang.String, int, java.lang.Object)'
        at io.ktor.server.engine.CommandLineKt.buildApplicationConfig(CommandLine.kt:110)
        at io.ktor.server.engine.CommandLineKt.CommandLineConfig(CommandLine.kt:41)
        at io.ktor.server.netty.EngineMain.main(EngineMain.kt:20)

FAILURE: Build failed with an exception.
m
What configuration did you use?
It works for me using the default. If you can reproduce, file a Youtrack?