I can't host ktor server

ilyaprofev
HOBBY

a year ago

I get an error
I'm encountering an issue when trying to build my project with the following command:
java -Xmx512m -jar build/libs/com.ilya.ktor-meetmap-all.jar

The error message I receive is:
Exception in thread "main" java.lang.IllegalArgumentException: Neither port nor sslPort specified. Use command line options -port/-sslPort or configure connectors in application.conf

Even when I try to specify the sslPort directly with the following command:
java -Xmx512m -jar build/libs/com.ilya.ktor-meetmap-all.jar -sslPort 8080

0 Replies

a year ago

do not specify anything relating to SSL as railway handles that for you.
you need to listen on the $PORT environment variable


a year ago

n/a


ilyaprofev
HOBBY

a year ago

I have already recorded this change in both the main file and configuration.conf


ilyaprofev
HOBBY

a year ago

fun main() {
val port = System.getenv("PORT")?.toInt() ?: 8080
embeddedServer(Netty, host = "0.0.0.0", port = port, module = Application::module).start(wait = true)
}


ilyaprofev
HOBBY

a year ago

1264280829010641000


ilyaprofev
HOBBY

a year ago

1264280894802497500


ilyaprofev
HOBBY

a year ago

@Brody And it doesn't help


a year ago

I don't have much experience with java so the best advice I could give would be to tell you to do some research on this error because it would not be platform specific


ilyaprofev
HOBBY

a year ago

Thanks, everything is fine


ilyaprofev
HOBBY

a year ago

I meant thanks for the advice


coltonidle
TRIAL

a year ago

ay. i do ktor exclusively on railway. lemme see if i can see whats up


coltonidle
TRIAL

a year ago

i did write this https://dev.to/coltonidle/how-to-deploy-a-ktor-app-on-railway-3jde
does that help by any chance?


ilyaprofev
HOBBY

a year ago

No it didn't help


coltonidle
TRIAL

a year ago

weird.


coltonidle
TRIAL

a year ago

let me go through my own tutorial again to see if something is now out of date


coltonidle
TRIAL

a year ago

following my tutorial everything works. sounds like something in your config is wrong


coltonidle
TRIAL

a year ago

if you have a sample repo that causes the issue id be more than happy to check it out


ilyaprofev
HOBBY

a year ago

I've earned everything


ilyaprofev
HOBBY

a year ago

I've done everything.


ilyaprofev
HOBBY

a year ago

Server is


ilyaprofev
HOBBY

a year ago

Working


a year ago

success?


coltonidle
TRIAL

a year ago

<:thinkies:1238577143466692739>


a year ago

good enough for me


coltonidle
TRIAL

a year ago

TIL about answer overflow!


a year ago

role given, congrats!


I can't host ktor server - Railway Help Station