https://kotlinlang.org logo
#ktor
Title
# ktor
r

Rohde Fischer

01/30/2021, 2:07 PM
I made a fairly small ktor project and am now trying to add Locations, but the second it's on the classpath (doesn't change if I install or don't) I get the following:
Copy code
Exception in thread "main" java.lang.AbstractMethodError: io.ktor.server.engine.ApplicationEngineEnvironmentReloading.getDevelopmentMode()Z
	at io.ktor.application.Application.<init>(Application.kt:20)
	at io.ktor.server.engine.ApplicationEngineEnvironmentReloading.instantiateAndConfigureApplication(ApplicationEngineEnvironmentReloading.kt:269)
	at io.ktor.server.engine.ApplicationEngineEnvironmentReloading.createApplication(ApplicationEngineEnvironmentReloading.kt:125)
	at io.ktor.server.engine.ApplicationEngineEnvironmentReloading.start(ApplicationEngineEnvironmentReloading.kt:245)
	at io.ktor.server.netty.NettyApplicationEngine.start(NettyApplicationEngine.kt:126)
	at io.ktor.server.netty.EngineMain.main(EngineMain.kt:26)
not sure where to go from here? This error isn't that descriptive
c

christophsturm

01/30/2021, 3:55 PM
sounds like a class path problem. can you check that you have the same version of all ktor jars in the classpath?
r

Rohde Fischer

01/30/2021, 4:38 PM
will check, but should be, I'm using a variable for them, I'll share my build.gradle, two secs
c

christophsturm

01/30/2021, 4:40 PM
you could add the bom to make sure that you have the correct ktor versions everywhere
r

Rohde Fischer

01/30/2021, 4:41 PM
I think you might be right on the version, just skimmed the ones IntelliJ refers to
image.png
c

christophsturm

01/30/2021, 4:43 PM
you can run
./gradlew dependencies
🙌 1
r

Rohde Fischer

01/30/2021, 4:43 PM
I think I spotted it, two secs
the netty server was set to 1.4.0
it's starting now, thanks a lot, for pointing me in the obvious direction 🙂 I guess we all go code blind at times
c

christophsturm

01/30/2021, 4:45 PM
add this:
Copy code
implementation(enforcedPlatform("io.ktor:ktor-bom:$ktorVersion"))
yw 🙂