Samuel Michael
01/30/2020, 11:41 PManthony castillo
01/31/2020, 2:43 AMOvsyannikov Alexey
01/31/2020, 6:57 AMio.ktor:ktor-client-encoding:1.3.0
in my java-only project, but I got error. After this I have used io.ktor:ktor-client-encoding-jvm:1.3.0
and it was successfully resolved. Is it known issue? In the jcenter you have redundant jars in package io/ktor/ktor-client-encoding/1.3.0 which, as I understand, must not be included in case if package is multiplatform-orientedeirikb
01/31/2020, 11:24 AMEfe
01/31/2020, 9:35 PMbash: build/install/myproject/bin/myproject: No such file or directory
I have the following line in my Procfile
web: build/install/myproject/bin/myproject
I am able to see this file in my ide. what should I use for my Procfile? Any guess would be appreciated. Thanksclhols
02/01/2020, 2:05 PMHttpClient(Ios) {
engine {
configureSession {
networkServiceType = NSURLNetworkServiceTypeBackground
}
}
}
But when doing that, I get the follow compile error:
Unresolved reference: NSURLNetworkServiceTypeBackground
I am using 1.3.0.Vincent Chen
02/03/2020, 9:12 AMimplementation("io.ktor:ktor-client-android:$ktor_version")
implementation("io.ktor:ktor-client-core:$ktor_version")
implementation("io.ktor:ktor-client-curl:$ktor_version")
....
I need to use HttpClient()
ThanksTrond Tunheim
02/03/2020, 10:20 AMAlejandro Rios
02/04/2020, 4:49 AMFelistas Ngumi
02/04/2020, 10:39 AMpackage com.example
import io.ktor.server.engine.embeddedServer
import io.ktor.server.netty.Netty
import io.ktor.routing.*
fun main() {
embeddedServer(Netty, port = 8080){ }.start()
routing {
get("/") {
call.respondText("Hello, world!", ContentType.Text.Html)
}
}
}
The issue i'm getting is, the routing package cannot be imported. Any assistance will be greatly appreciated.nrobi
02/04/2020, 11:40 AMkotlinx-serialization
with ktor
however I’m receiving a java.lang.NoClassDefFoundError
with call.receive<MyModel>
. Any clue what could be wrong with the setup?bitkid
02/04/2020, 12:43 PMNikky
02/04/2020, 12:54 PMTimur Atakishiev
02/04/2020, 3:40 PMenleur
02/04/2020, 5:40 PMDavid Gethers
02/04/2020, 11:56 PMkotlinx.serialization
and the exception occurs with call.receive<MyMode>
. I’m curious if it a similar issue is the same as @nrobi. I don’t get the java.lang.NoClassDefFoundError
but I do get io.ktor.features.CannotTransformContentToTypeException: Cannot transform this request's content to
. I followed the instructions in https://ktor.io/servers/features/content-negotiation/serialization-converter.html and https://ktor.io/servers/calls/requests.html. I have the correct grade entry in my build.gradle file:
implementation "io.ktor:ktor-serialization:$ktor_version"
I install the ContentNegotiator:
fun Application.module() {
install(ContentNegotiation) {
serialization(
contentType = ContentType.Application.Json,
json = Json(DefaultJsonConfiguration.copy(prettyPrint = true))
)
}
val dao = DAOFacadeDatabase(Database.connect("jdbc:h2:mem:test;DB_CLOSE_DELAY=-1", driver = "org.h2.Driver"))
val server = embeddedServer(Netty, port = 8080) {
I have my simple data class:
data class UrlMap(val id: String, val url: String, val userId: String)
The exception is thrown here:
val receive = call.receive<UrlMap>()
I follow multiple examples on website and the official Ktor documentation and I can’t get it to work. I’m using Ktor 1.3.0 with Kotlin 1.3.61.
Any help would be greatly appreciatedtylerwilson
02/05/2020, 10:10 PMlouiscad
02/06/2020, 10:25 AMktor-http
artifact. Not referenced in https://ktor.io/quickstart/artifacts.html either, and no README about it on GitHub.muliyul
02/06/2020, 10:42 AMJdbi.create(HikariDataSource(HikariConfig().apply {
username = config.property("db.username").getString()
password = config.property("db.password").getString()
jdbcUrl = config.property("db.jdbcUrl").getString()
application.featureOrNull(DropwizardMetrics)?.registry?.also {
<http://application.log.info|application.log.info>("Dropwizard metrics feature detected. Registering HikariCP metrics.")
metricRegistry = it
healthCheckRegistry = it
}
}
but getting an error:
java.lang.NoClassDefFoundError: com/codahale/metrics/health/HealthCheckRegistry
at com.zaxxer.hikari.HikariConfig.setHealthCheckRegistry(HikariConfig.java:697)
eirikb
02/06/2020, 2:24 PMSlackbot
02/06/2020, 3:59 PMClyde
02/07/2020, 1:14 AMio.ktor.server.engine.BaseApplicationResponse$ResponseAlreadySentException: Response has already been sent
at io.ktor.server.engine.BaseApplicationResponse.commitHeaders (BaseApplicationResponse.kt:44)
at io.ktor.server.engine.BaseApplicationResponse.respondOutgoingContent$suspendImpl (BaseApplicationResponse.kt:108)
at io.ktor.server.engine.BaseApplicationResponse.respondOutgoingContent (BaseApplicationResponse.kt)
The code generating the response is:
call.respondRedirect(signedUrl)
where signedUrl
is a string with a URL. The redirect works - the client gets the correct result and redirects to the new path. Just wondering why there is an exception.Maurice Wingbermuhle
02/07/2020, 12:33 PMJordan Terrell
02/07/2020, 2:01 PMBrindasanth
02/07/2020, 11:30 PMRodrigo Silva
02/08/2020, 9:38 PMCLOVIS
02/09/2020, 7:15 PMHttpClient()
in the common code, or to expect
the client from each platform to have more granular settings (but maybe code duplication as well?)Jordan Terrell
02/10/2020, 3:19 PMpavel
02/10/2020, 9:47 PMTony
02/11/2020, 8:16 PMTony
02/11/2020, 8:16 PMcy
02/11/2020, 8:17 PMTony
02/11/2020, 8:17 PMcy
02/11/2020, 8:18 PMTony
02/11/2020, 8:19 PMcy
02/11/2020, 8:19 PMTony
02/11/2020, 8:22 PMlouiscad
02/17/2020, 3:12 PM