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.

IllegalArgumentException: Neither port nor sslPort specified.

See original GitHub issue

For 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:closed
  • Created 5 years ago
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

11reactions
pirituscommented, Jan 15, 2019

There was the same problem after the update of the IDE, it helped “Sync Project with Gradle Files”

1reaction
cy6erGn0mcommented, Dec 7, 2018

That’s quite strange that you have orange test and out directories. For sure something is misconfigured.

application.conf should be in out directory, like this:

screenshot_20181207_151208

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

Read more comments on GitHub >

github_iconTop 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 >

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