question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

No configuration setting found for key 'ktor'

See original GitHub issue

Run exception

Exception in thread "main" com.typesafe.config.ConfigException$Missing: No configuration setting found for key 'ktor'
	at com.typesafe.config.impl.SimpleConfig.findKeyOrNull(SimpleConfig.java:152)
	at com.typesafe.config.impl.SimpleConfig.findOrNull(SimpleConfig.java:170)
	at com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:184)
	at com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:189)
	at com.typesafe.config.impl.SimpleConfig.getObject(SimpleConfig.java:264)
	at com.typesafe.config.impl.SimpleConfig.getObject(SimpleConfig.java:37)
	at io.ktor.server.engine.CommandLineKt$commandLineEnvironment$environment$1.invoke(CommandLine.kt:57)
	at io.ktor.server.engine.CommandLineKt$commandLineEnvironment$environment$1.invoke(CommandLine.kt)
	at io.ktor.server.engine.ApplicationEngineEnvironmentBuilder.build(ApplicationEngineEnvironment.kt:55)
	at io.ktor.server.engine.ApplicationEngineEnvironmentKt.applicationEngineEnvironment(ApplicationEngineEnvironment.kt:38)
	at io.ktor.server.engine.CommandLineKt.commandLineEnvironment(CommandLine.kt:50)
	at io.ktor.server.netty.DevelopmentEngine.main(DevelopmentEngine.kt:13)

build.gradle.kts

import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.jetbrains.kotlin.gradle.dsl.Coroutines

val ktor_version = "0.9.3"

plugins {
    application
    kotlin("jvm") version "1.2.51"
}

application {
    mainClassName = "io.ktor.server.netty.DevelopmentEngine"
}

group = "ktor3"
version = "1.0-SNAPSHOT"

repositories {
    jcenter()
    maven("http://kotlin.bintray.com/ktor")
    mavenCentral()
}


dependencies {
    implementation(kotlin("stdlib-jdk8"))
    implementation("io.ktor:ktor-server-netty:$ktor_version")
    implementation("ch.qos.logback:logback-classic:1.2.1")
}

tasks.withType<KotlinCompile> {
    kotlinOptions.jvmTarget = "1.8"
}
kotlin {
    experimental.coroutines = Coroutines.ENABLE
}

application.conf

ktor {
  deployment {
    port = 8080
  }

  application {
    modules = [ com.kodal.AppKt.main ]
  }
  security {

  }
}

App.kt

package com.kodal

import io.ktor.application.Application
import io.ktor.application.call
import io.ktor.application.install
import io.ktor.features.CallLogging
import io.ktor.features.DefaultHeaders
import io.ktor.response.respondText
import io.ktor.routing.Routing
import io.ktor.routing.get

fun Application.main() {
    install(DefaultHeaders)
    install(CallLogging)
    install(Routing) {
        get("/") {
            call.respondText("Hello")
        }
    }
}

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:16 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
ti4n1993commented, Oct 15, 2018

Yes,it only contains kotlin.sourceSets["main"].kotlin.srcDirs("src") kotlin.sourceSets["test"].kotlin.srcDirs("test")

0reactions
ti4n1993commented, Oct 25, 2018

Thanks

Read more comments on GitHub >

github_iconTop Results From Across the Web

No configuration setting found for key typesafe config
The ConfigFactory.load function will attempt to load the configuration from a variety of places. By default it will look for a file named ......
Read more >
Wrong exception is thrown on missing config : KTOR-4286
KTOR -4206 The "com.typesafe.config.ConfigException$Missing" exception leaks from the typesafe config library when configuration is merged.
Read more >
Struggling with "No configuration setting found for key 'akka'"
I am able to run the tests successfully in my IntelliJ IDEA. However, when I run `sbt test` the test is failing with...
Read more >
FAQ - Ktor
How to resolve 'No configuration setting found for key ktor'? ... This means that Ktor was not able to find a configuration file....
Read more >
Solved: Oryx: No configuration setting found for key 'mode...
Solved: Hello I got these error form Ory computation layer: ven. févr. 07 13:45:41 CET 2014 Infos Starting run - 5841.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found