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

395
Views
El análisis de Ktor JSON en la solicitud posterior no funciona

Cada vez que envío una solicitud de publicación del cartero y el servidor da este error, incluso comprobé si estoy recibiendo Content-Type = Application/ JSON . Pero sigue dando este error.

Causado por: java.lang.NoSuchMethodError: java.nio.ByteBuffer.limit(I)Ljava/nio/ByteBuffer;

Aquí están mis archivos

Archivo de solicitud:

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

Petición:

 post("/login") { val userInfo = call.receive<UserInfo>() println(userInfo) call.respondText("Everything is working fine") }

Clase de modelo:

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

0

Así que resolví este problema cambiando Project SDK 1.8 a 11.

ingrese la descripción de la imagen aquí

over 4 years ago · Santiago Trujillo Report

0

ktor_version:1.6.7 solucionó este problema.

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!