grails reload classes runtime - grails

I started to modify a grails application created from someone else. I can't understand why when I try to use run-app and I modify a controller, grails won't reload it at runtime. I have to stop and restart it, this is very frustrating.
I'm using the normal development environment.
OS Ubuntu 11.10, Grails 2.0.1
Can someone help me undestand why?
Cheers

The problem was Eclipse (STS), when you modify the class from there but execute the run-app from console it will not reload, it was just execute run-app from eclipse

Related

How to enable Grails 3.x auto-reload?

I am unable to get auto-reloading working on newly created controllers. My application starts correctly but whenever i do grails create-controller <controller-name> the controller is created and i see that the new controller is compiled.
When i try to access the newly generated controller I always get a "Page not Found (404)". After restarting the Grails application, the newly created controller works correctly.
I am using Grails 3.0.1 on OSX Yosimite and Java 1.8.0_31-b13. Any clue on how to fix this?
I am starting the application using the following combinations:
grails run-app
grails -reloading run-app
grails run-app -reloading
None of these worked reloading the new created controller
Grails introduced what I'd consider a bug in version 2.4.4 and still present in at least 3.0.4, where automatic reloading doesn't work if you have space anywhere in the file's (in this case the controller's) path.
See this post for more details.
what worked for grails 2.x must be working for 3.x as well.
Try below command, setting this to false must allow reloading.
grails -Ddisable.auto.recompile=false run-app

Grails app running but unresponsive after upgrade from 2.2.4 to 2.4.2

After upgrading our app from Grails 2.2.4 to 2.4.2 and working through all the dependency changes, etc., the app is running but bootstrap is not executing and no pages show up. I don't get any errors even when running with --stacktrace --verbose. I just get the normal app running message as if all was well. Nothing in the stacktrace.log file or the application log file.
Does anyone have any ideas on how to go about troubleshooting this?
Thanks,
Dave

Grails autocompile not in development environment

I am running Grails 2.1 in a environment called "local" because "development" is reserved for a staging system. But I want to have to auto compile like in dev mode, i.e. if I am changing a controller the changes are compiled at one without rerunning "run-app". The parameter grails.gsp.enable.reload=true doesn't work.
Any hints are highly appreciated. Thanks in advance
Reto
Try starting up with
grails local -reloading run-app

Reloading bootstrap with Grails

Is there a way in Grails to run the contents of BootStrap.groovy after it has been changed without restarting the app?
You can do this with the console plugin. I'd highly recommend this plugin for any development environment because it's so useful for running ad-hoc code inside a running server.
To rerun your BootStrap init closure, browse to the web-based console at http://localhost:8080/appname/console. Enter the following in the console:
def servletCtx = org.codehaus.groovy.grails.web.context.ServletContextHolder.servletContext
def myBootstrapArtefact = grailsApplication.getArtefacts('Bootstrap')[-1]
myBootstrapArtefact.referenceInstance.init(servletCtx)

Does Grails run the Bootstrap.groovy script when deploying the app as a war?

Bootstrap executes fine during run-app (database is seeded). But it doesn't appear to get invoked when Tomcat deploys the war (nothing in the database).
Does the Bootstrap get run during war deployment? If not, is there a way to make it run?
Specifically I am wanting my sample data to seed the database.
Yes it does....
i would look to make sure you have your environments configured properly if you see thing working in development, but not production

Resources