IllegalArgumentException: Neither port nor sslPort specified.
See original GitHub issueFor Ktor 1.0.0 server, java version 1.8.0_181 (running server on localhost, Ubuntu 18.04.1 LTS)
Facing the following issue:
Exception in thread "main" java.lang.IllegalArgumentException: Neither port nor sslPort specified. Use command line options -port/-sslPort or configure connectors in application.conf
at io.ktor.server.engine.CommandLineKt$commandLineEnvironment$environment$1.invoke(CommandLine.kt:121)
at io.ktor.server.engine.CommandLineKt$commandLineEnvironment$environment$1.invoke(CommandLine.kt)
at io.ktor.server.engine.ApplicationEngineEnvironmentBuilder.build(ApplicationEngineEnvironment.kt:95)
at io.ktor.server.engine.ApplicationEngineEnvironmentKt.applicationEngineEnvironment(ApplicationEngineEnvironment.kt:40)
at io.ktor.server.engine.CommandLineKt.commandLineEnvironment(CommandLine.kt:50)
at io.ktor.server.netty.EngineMain.main(EngineMain.kt:16)
at com.gurpreetsk.ApplicationKt.main(Application.kt:36)
However, the application.conf
file contains the following:
ktor {
deployment {
port = 8080
port = ${?PORT}
}
application {
modules = [ com.gurpreetsk.ApplicationKt.module ]
}
}
Issue Analytics
- State:
- Created 5 years ago
- Comments:11 (4 by maintainers)
Top Results From Across the Web
How to fix 'Neither port nor sslPort specified ... - Stack Overflow
IllegalArgumentException: Neither port nor sslPort specified. Use command line options -port/-sslPort or configure connectors in ...
Read more >Neither port nor sslPort specified" when running via Gradle ...
"IllegalArgumentException: Neither port nor sslPort specified" when running via Gradle Application plugin. Relates to 1.
Read more >Bad experience with Ktor setup : r/Kotlin - Reddit
yet when I run the app I get this error: "Neither port nor sslPort specified. Use command line options -port/-sslPort or configure connectors...
Read more >Publishing server-side Kotlin applications: Ktor on Heroku
IllegalArgumentException : Neither port nor sslPort specified. Use command line options -port/-sslPort or configure connectors in ...
Read more >How to fix 'Neither port nor sslPort specified' throw by io.ktor ...
Coding example for the question How to fix 'Neither port nor sslPort specified' throw by io.ktor.server.engine.CommandLineKt in a gradle/kotlin/netty ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
There was the same problem after the update of the IDE, it helped “Sync Project with Gradle Files”
That’s quite strange that you have orange test and out directories. For sure something is misconfigured.
application.conf
should be inout
directory, like this:I’ve just tried to create a project using ktor plugin and it runs just fine in IDEA and via gradle as well. Same for website https://start.ktor.io