Hello guys, I'm getting a really rare issue when d...
# ktor
s
Hello guys, I'm getting a really rare issue when deploying the backoffice. I only can deploy the module with the "run" task: - I've tried to configure a build configuration like this (Netty): https://ktor.io/servers/engine.html but the error is is
Copy code
No configuration setting found for key 'ktor'
The application.conf is in resources directory, and "run" task configuration is based on it, so... I don't understand anything. I've also tried to create a new project like https://ktor.io/quickstart/faq.html#cannot-find-application-conf is suggesting, but I'm getting the same issue Also, If I try to run with "play button on main class" on IntelliJ, IntelliJ says "cannot find main class"
d
Have you tried to generate a project with this? https://ktor.io/quickstart/generator.html
s
Yep
d
And how are you trying to deploy the module?
s
with: gradlew backendrun works
But with run config nope
image.png
d
Oh you mean running using IntelliJ
s
Yes yes, with gradle works fine
(except autoreload)
d
Depending on the kind of project there are a few known issues. I’d suggest to execute the
:run
gradle task instead. You can also redirect run and test tasks to use gradle
like this:
Screenshot 2018-10-16 at 18.32.13.png
s
But with
Copy code
gradlew run
autoreload doesn't work
By the way, the project is available on github, I'm playing with the multiplatform libs https://github.com/sergiocasero/votlin-app/tree/feature/backend_get_talks
d
Running mpp projects have some issues like that one I guess
Though it should work fine for pure JVM projects
s
Ok ok, thanks 🙂
👍 1
c
I am seeing the same issue now
autoreload doesn't apply the changes, when I enable the DEBUG logging, I can see a bunch of classes traced from ktor: log.debug("Class Loader: $baseClassLoader: ${debugUrls.filter { !it.toString().startsWith(jre) }}")
this code is from ApplicationEngineEnvironment.kt
but when I refresh my webpage, changes are not reflected, it's still running on the old code
I am using gradle build -t
and
gradle run
if I go and manually delete the classes, indeed gradle triggers and rebuilds them, then ktor traces again all classes on page reload, but changes are not applied looks like
I am running on 1.2.61, ktor 0.9.4
Carlos u there?
d
Yes, now I’m here. Let me read
Which java version are you using?
c
1.8.0_172
yes I am aware Java 9 doesn't support autoreload, correct?
It's really weird because when I tried this feature months ago, it was working fine
d
Right, it uses ClassLoading stuff and with newer java versions they changed how all that works to make java more aot-friendly
let me check
Works for me
in one terminal
./gradlew build -t
, in other
./gradlew run
and then changing
Hello World
to something else, changes it.
c
I am using kotlin 1.2.61, might that affect something?
the gradle version is 4.10 over here
d
Gradle 4.10.2
and
java version "1.8.0_162"
here. Not sure. I’d suggest you to try the same as me (the
exercise4
with your gradle and java versions) and if it works then mutate versions until it doesn’t work for you and then report. Can’t think of anything else to figure out what’s going on
c
ok I'll try this evening
👌 1
🙏 1