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

Trond Øydna

11/19/2021, 4:10 PM
Hello 👋 After updating ktor to 1.6.5 my tests have started failing with the exception
java.lang.NoSuchMethodError: java.nio.ByteBuffer.limit(I)Ljava/nio/ByteBuffer;
using ktor-server-tests. I've not been able to find any other reports of this error here or on YouTrack. In the failing tests I'm making a mock request using
io.ktor.server.testing.handleRequest
. This has been working fine up until 1.6.5 Any ideas on what might cause this? I've added more details in thread. Edit: It seems it could be the JDK version, tests fail on 8 but not on 17. My JVM target is 1.8 and I'm dependent on kotlin-stdlib-jdk8
My direct dependencies are: (all version 1.6.5)
Copy code
Compile:
ktor-server-core
ktor-server-netty
ktor-client-core
ktor-client-okhttp
ktor-client-serialization-jvm
ktor-serialization
ktor-client-auth-jvm
ktor-auth
ktor-auth-jwt
ktor-client-logging-jvm
ktor-metrics-micrometer

Test:
ktor-server-tests
Netty is 4.1.69 through ktor. Kotlin version is 1.5.31 JDK version is 1.8_302
Server stacktrace: https://pastebin.com/xneNu7Wd password is "ktor" How do you usually share large amount of text here? Could not create text snipper or upload files
a

Aleksei Tirman [JB]

11/19/2021, 5:13 PM
This issue is known (KTOR-3358) and will be fixed in the next patch release.
t

Trond Øydna

11/19/2021, 5:23 PM
Perfect, thanks!
4 Views