Thanks for the nice tutorial!
I'm having a lot of trouble with application.conf, where to place it, so that Heroku sees it. I can run the App in IntelliJ, but when using Heroku I get:
Exception in thread "main" java.lang.IllegalArgumentException: Neither port nor sslPort specified. Use command line options -port/-sslPort or configure connectors in application.conf
Unfortunately I can't see an image, but if you're using the structure generated by the wizard, your application.conf should have been automatically placed in the right directory – resources/main/application.conf. Generally, application.conf needs to be inside your resources directory.
You could also trying running the application locally through your gradle wrapper (i.e. ./gradlew run, and see if that works. If not, it might be indicative of some other issue.
I forgot to mention that when generating a project like in your tutorial, it goes fine. my difference is that i'm doing the multi-platform Kotlin/KotlinJs
Thanks for sharing the project. I investigated this by running installDist locally, which creates a "start script" in /build/install/qlciscte/bin – and that indeed throws a IllegalArgumentException: Neither port nor sslPort specified.
now it works when I run the binary produced by gradle stage. however, when uploading to Heroku, the app still crashes. Here's the log entry:
2021-01-28T11:18:09.671617+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=qlciscte.herokuapp.com request_id=fbea81df-588f-443f-a520-7072d3110169 fwd="94.63.156.9" dyno= connect= service= status=503 bytes= protocol=https
It's not very informative. Do you know any trick to get a more detailed trace of what went wrong on Heroku?
meanwhile I also noticed that :) now I have another problem, but that has to with class version compilation of some libs i'm using.
thanks for the tip!
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Thanks for the nice tutorial!
I'm having a lot of trouble with application.conf, where to place it, so that Heroku sees it. I can run the App in IntelliJ, but when using Heroku I get:
Exception in thread "main" java.lang.IllegalArgumentException: Neither port nor sslPort specified. Use command line options -port/-sslPort or configure connectors in application.conf
The image shows my project structure.
Any hints to overcome this?
Unfortunately I can't see an image, but if you're using the structure generated by the wizard, your
application.conf
should have been automatically placed in the right directory –resources/main/application.conf
. Generally,application.conf
needs to be inside yourresources
directory.You could also trying running the application locally through your gradle wrapper (i.e.
./gradlew run
, and see if that works. If not, it might be indicative of some other issue.thanks for quick answer!
(at the end the image did not attach... i'm new here)
perhaps like this is easier:
github.com/andre-santos-pt/qlciscte
gradlew run works well locally.
gradle stage, compiles ok, but when running the build I get that port error. (and the same when uploading to heroku)
I forgot to mention that when generating a project like in your tutorial, it goes fine. my difference is that i'm doing the multi-platform Kotlin/KotlinJs
Thanks for sharing the project. I investigated this by running
installDist
locally, which creates a "start script" in/build/install/qlciscte/bin
– and that indeed throws aIllegalArgumentException: Neither port nor sslPort specified.
And in fact, you're actually hitting a bug here! More specifically, KT-37964 Gradle application/distribution plugin does not copy and name jar files correctly when using installDist task for multiplatform project.
The TLDR:
installDist
generates a script with an entry point using your projects.jar
, which the isn't properly being copied. The workaround:Hope this will be fixed in due time. Tripped me up as well, as you can see :)
You can also find a working Gradle configuration in the companion project for the "Building a Full Stack Web App with Kotlin Multiplatform" hands-on tutorial.
now it works when I run the binary produced by gradle stage. however, when uploading to Heroku, the app still crashes. Here's the log entry:
2021-01-28T11:18:09.671617+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=qlciscte.herokuapp.com request_id=fbea81df-588f-443f-a520-7072d3110169 fwd="94.63.156.9" dyno= connect= service= status=503 bytes= protocol=https
It's not very informative. Do you know any trick to get a more detailed trace of what went wrong on Heroku?
Discovered the issue by running
heroku logs --tail
before actually triggering a build. That gave me:You might want to adjust the contents of your
Procfile
, since your project is no longer calleduntitled
😉meanwhile I also noticed that :) now I have another problem, but that has to with class version compilation of some libs i'm using.
thanks for the tip!