Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

404
Views
Ktor JSON Parsing on Post Request is not working

Every time I send a post request from the postman and the server gives this error, even I checked if I'm receiving Content-Type = Application/ JSON. But still giving this error.

Caused by: java.lang.NoSuchMethodError: java.nio.ByteBuffer.limit(I)Ljava/nio/ByteBuffer;

Here are my files

Application File:

fun main() {
    embeddedServer(Netty, port = 8080, host = "192.168.0.109") {
        install(ContentNegotiation){
            json()
        }
        configureRouting()
    }.start(wait = true)
}

Request:

post("/login") {

    val userInfo = call.receive<UserInfo>()
    println(userInfo)

    call.respondText("Everything is working fine")
}

Model Class:

@Serializable
data class UserInfo(
    val email: String,
    val password: String
)
over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

So I Solved This Issue by Changing Project SDK 1.8 to 11.

enter image description here

over 4 years ago · Santiago Trujillo Report

0

ktor_version:1.6.7 has fixed this problem.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!