Creating HttpClient with Apache engineFactory doesn't work
See original GitHub issueKtor Version and Engine Used (client or server and name) version, client/server, additional ktor modules included ktor 1.2.2 kotlin 1.3.41
dependencies
compile "ch.qos.logback:logback-classic:$logback_version"
compile "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.9.2"
compile "com.google.appengine:appengine:$appengine_version"
compile "com.google.cloud:google-cloud-logging-logback:$gce_logback_version"
compile "io.ktor:ktor-auth:$ktor_version"
compile "io.ktor:ktor-client-apache:$ktor_version"
compile "io.ktor:ktor-client-auth-jvm:$ktor_version"
compile "io.ktor:ktor-client-core-jvm:$ktor_version"
compile "io.ktor:ktor-client-core:$ktor_version"
compile "io.ktor:ktor-html-builder:$ktor_version"
compile "io.ktor:ktor-jackson:$ktor_version"
compile "io.ktor:ktor-locations-metadata:$ktor_version"
compile "io.ktor:ktor-locations:$ktor_version"
compile "io.ktor:ktor-server-core:$ktor_version"
compile "io.ktor:ktor-server-netty:$ktor_version"
compile "io.ktor:ktor-server-servlet:$ktor_version"
compile "net.logstash.logback:logstash-logback-encoder:5.1"
compile "org.jetbrains:kotlin-css-jvm:1.0.0-pre.31-kotlin-1.2.41"
compile 'com.google.cloud:google-cloud-firestore:1.11.0'
compile 'com.google.cloud:google-cloud-storage:1.38.0'
compile 'org.koin:koin-ktor:2.0.1'
testCompile "io.ktor:ktor-server-tests:$ktor_version"
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
Intelij:
IntelliJ IDEA 2019.1.3 (Ultimate Edition)
Build #IU-191.7479.19, built on May 28, 2019
JRE: 1.8.0_202-release-1483-b58 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.14.1
Describe the bug When installin Authentication module I need to create an Apache client. Doing that by using the constructor with engineFactory causes a weird error where Inteliji syntax is almost error like colour (#C53A47). When hovering over - no explanation, when I start the app it says that client lateinit var has never been initialized.
To Reproduce Follow official tutorial for adding authentication.
Expected behavior Adding http client by following factory object (Apache).
My workaround (1st line on the screenshot) is to use the constructor with engine (not engineFactory) and calling build() on Apache object.
Screenshots
Please accept my apologies if I posted this in a wrong place or this is obvious. It’s just my best intention to help others to avoid this behaviour.
Thanks
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
https://www.dropbox.com/s/p8pb0sgggo7pf4u/selfcontained_example_for_issue_1234.zip?dl=0
Can’t reproduce with Ktor 2.0.0