Unable to reload app

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Unable to reload app

terribleherbst
Hi folks, I've got some starting problems using ratpack. One of the awesome features is the reloading of application classes without restarting the whole app. That is excatly what I was looking for.

Unfortunately I didn't get this thing working. I've checkout the gradle and java example app from Github via IntelliJ and created the IDEA config using gradlew idea. After that I started the app via gradlew run and changed the ReloadingThing from the source. But nothing happens. I've started a new build in IntelliJ and also used gradlew classes. Nothing happend. I've already added
systemProperty "ratpack.reloadable", "true"
to the gradle script but that also didn't help.
Any more hints? The documentation says something about a groovy-web-console.ipr but I didn't find such a file in the git repository.
So any hints are welcome.
Reply | Threaded
Open this post in threaded view
|

Re: Unable to reload app

danveloper
Administrator
With the Java example, Ratpack will not background compile changed classes, so you'll need to invoke the compilation on your own. After that, Ratpack will reload those changes. In IDEA, while the app is running, if you right click within the class file and choose "Compile .java", then Ratpack will reload the changed class. If you're running form within the IDE, after the recompilation has taken place you should see a notification in the bottom left that says something to the effect of "9 classes reloaded".
Reply | Threaded
Open this post in threaded view
|

Re: Unable to reload app

terribleherbst
I've checked this again. How to I have to run ratpack? I've started the app with the gradle task and added a new route but nothing changes. I've also started the MyApp direct from IDE.

This is my stacktrace
[main] INFO ratpack.server.RatpackServer - Ratpack started for http://localhost:5050
Received: /reloadexample
Received: /favicon.ico
Received: /joe/
Received: /favicon.ico

IntelliJ shows me a message (Compilation successfull...) but there is no reload message in the log. Maybe I have to configure something else?
Reply | Threaded
Open this post in threaded view
|

Re: Unable to reload app

terribleherbst
So I did some more investigation. It seems the reloading depends on springloaded, which is no longer part of the build script cause it works only with the latest SNAPSHOT. Also reloading of routes seems not to be supported but reloading of classes (or Lambdas) seems to work.
I've got the reloading working on my command line, I guess IDEA seems to have some problems with class directory.
Anybody a working reloading example out their?
Reply | Threaded
Open this post in threaded view
|

Re: Unable to reload app

Jamie Echlin
I realise this is several months later, but just in case it helps anyone else...

I had the same problem with ReloadingThing. The reason was because I had previously told IDEA to "Never" reload changed classes. If you search in IDEA settings for "reload", you can set it back to Ask or Always. After I did that it works.

cheers, jamie