Closed allphfa closed 6 years ago
@AlphaFase Looks like you aren't compiling the entire standard library into your project.
Do you mind providing your project's maven pom/gradle build file? And also information about this runtime environment.
build.gradle
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.4'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
plugins {
id 'java'
id 'org.jetbrains.kotlin.jvm' version '1.2.70'
}
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'kotlin'
apply plugin: 'application'
mainClassName = 'io.ktor.server.netty.DevelopmentEngine'
/*
sourceSets {
main.kotlin.srcDirs = [ 'src/main/kotlin' ]
//test.kotlin.srcDirs = [ 'src/test/kotlin' ]
//main.resources.srcDirs = [ 'src/mian/resources' ]
}
*/
group 'fastpay'
version '1.0-SNAPSHOT'
sourceCompatibility = 1.8
repositories {
mavenCentral()
jcenter()
maven { url "http://kotlin.bintray.com/ktor" }
maven { url "https://kotlin.bintray.com/kotlin-js-wrappers" }
maven { url 'https://jitpack.io' }
}
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
testCompile group: 'junit', name: 'junit', version: "$junit_version"
compile "org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlinx_coroutines_version"
compile "io.ktor:ktor:$ktor_version"
compile "io.ktor:ktor-server-netty:$ktor_version"
compile "io.ktor:ktor-html-builder:$ktor_version"
compile "ch.qos.logback:logback-classic:$logback_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"
testCompile "io.ktor:ktor-server-tests:$ktor_version"
compile "io.ktor:ktor-gson:$ktor_version"
compile "io.ktor:ktor-locations:$ktor_version"
// https://github.com/KDatabases/Kedis
compile "redis.clients:jedis:$jedis_version"
// http://litote.org/kmongo/
compile "org.litote.kmongo:kmongo:$kmongo_version"
compile 'com.uchuhimo:konf:0.11'
compile "com.sxtanna.database:Kedis:+"
}
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
kotlin.experimental.coroutines = 'enable'
gradle.properties
kotlin_version = 1.2.70
ktor_version = 0.9.5
logback_version = 1.2.3
slf4j_version = 1.7.25
gce_logback_version = 0.60.0-alpha
kotlinx_coroutines_version = 0.25.0
kotlinx_serialization_version = 0.6.2
junit_version = 4.12
kmongo_version = 3.8.3
jedis_version = 2.9.0
redis.conf
{
"server": {
"address": "127.0.0.1",
"port": 6379
},
"user": {
"auth": "xxxx",
"defaultDB": 0
},
"pool": {
"maxSize": 200,
"idleSize": 200,
"timeout": 0
}
}
main.kt
package io.fastpay
import io.fastpay.order.orderApi
import io.ktor.application.Application
import io.ktor.application.install
import io.ktor.features.CallLogging
import io.ktor.features.DefaultHeaders
import io.ktor.locations.Locations
import io.ktor.routing.routing
fun Route.orderApi() {
runBlocking {
val redis = Kedis.get(File(this.javaClass.getResource("/redis.conf").toURI()))
redis.enable()
redis {
}
// here error
println(1111)
}
}
fun Application.main() {
install(DefaultHeaders)
install(CallLogging)
install(Locations)
routing {
orderApi()
}
}
mian class: io.ktor.server.netty.DevelopmentEngine
resources > application.conf
ktor {
deployment {
port = 80
watch = [ io.fastpay.MainKt ]
}
application {
modules = [ io.fastpay.MainKt.main ]
}
}
online wait
@AlphaFase Ok, I've identified the issue.
In the newer version of Kotlin, they have moved these functions from
kotlin.AutoCloseableKt
to
kotlin.io.CloseableKt
A simple fix for this would just be a recompilation on my end, and then a quick push to central. I can make a release on here with the new binaries, and you would just need to install it manually. (or wait for central to refresh with the new update).
ok
@AlphaFase
Addressed in https://github.com/KDatabases/Core/commit/f12ba983726cceb6d75dad62c1ed2f260e788cbc and integrated in https://github.com/KDatabases/Kedis/commit/b15b59ffe9e7eace55c3d35f89c16cd87cea4135
Push to central should be done in a couple of hours