Auto-reloading in Grails 2.4?

616 views
Skip to first unread message

hc

unread,
Mar 26, 2015, 3:33:38 PM3/26/15
to grails-de...@googlegroups.com
I downloaded GGTS 3.6.4, created a new Grails project, created a new controller. When I run-app, then edit a controller, it auto-recompiles, but I don't see the change in the browser.

Editing GSPs, I see the changes in the browser immediately.

Googling this, I see talk about forked execution, and maybe reloading doesn't work with that? It's not clear to me.

I'm confused. Is auto-reloading supposed to work in Grails 2.4.4?

Thanks.

jonatha...@gmail.com

unread,
Mar 26, 2015, 3:38:43 PM3/26/15
to grails-de...@googlegroups.com
Try using run-app -reloading. Reloading was no longer default in Grails 2.3. See http://grails.github.io/grails-doc/2.4.x/guide/upgradingFrom22.html

hc

unread,
Mar 26, 2015, 4:17:35 PM3/26/15
to grails-de...@googlegroups.com
You're saying it's not supposed to work by default, but it's possible to make it work.

Is it working for you?

I tried Grails Tools > Open Grails Command Prompt and entered:
-reloading run-app
And also:
run-app -reloading
I also tried putting those as the "Run Command" in the "Run Configuration".

No effect.

This is a stripped down, new Grails project, with a controller that just does:
def index() { render "hello world"}

I'm changing that "hello world" text.

Thanks.

Aaron

unread,
Mar 26, 2015, 4:21:36 PM3/26/15
to grails-de...@googlegroups.com
If you are running with forked mode (the default, I believe), reloading should be enabled.

If you disabled forked mode, you need to enable reloading with the command line switch. Optionally you can edit the startGrails.sh script and change the DISABLE_RELOADING=true flag to false.

When you are running, what is the value of:

grails.util.Environment.reloadingAgentEnabled

hc

unread,
Mar 26, 2015, 4:41:37 PM3/26/15
to grails-de...@googlegroups.com

The value of grails.util.Environment.reloadingAgentEnabled is true.

Also, I left grails.project.fork as it was:

grails.project.fork = [
    // configure settings for compilation JVM, note that if you alter the Groovy version forked compilation is required
    //  compile: [maxMemory: 256, minMemory: 64, debug: false, maxPerm: 256, daemon:true],

    // configure settings for the test-app JVM, uses the daemon by default
    test: [maxMemory: 768, minMemory: 64, debug: false, maxPerm: 256, daemon:true],
    // configure settings for the run-app JVM
    run: [maxMemory: 768, minMemory: 64, debug: false, maxPerm: 256, forkReserve:false],
    // configure settings for the run-war JVM
    war: [maxMemory: 768, minMemory: 64, debug: false, maxPerm: 256, forkReserve:false],
    // configure settings for the Console UI JVM
    console: [maxMemory: 768, minMemory: 64, debug: false, maxPerm: 256]
]

Chris Davis

unread,
Jul 9, 2015, 9:15:32 AM7/9/15
to grails-de...@googlegroups.com
Did you get it working, I am having the same issue and none of the suggested fixes are having any effect

Jeff Scott Brown

unread,
Jul 9, 2015, 9:23:49 AM7/9/15
to grails-de...@googlegroups.com

> On Jul 9, 2015, at 8:15 AM, Chris Davis <chris...@gmail.com> wrote:
>
> Did you get it working, I am having the same issue and none of the suggested fixes are having any effect

Are you running in forked mode?

What operating system are you using?

What JDK?

Thanks for the feedback.



JSB

Jeff Scott Brown
Principal Software Engineer
Grails Development Team
Object Computing Inc.
http://www.ociweb.com/

Autism Strikes 1 in 166
Find The Cause ~ Find The Cure
http://www.autismspeaks.org/

Chris Davis

unread,
Jul 12, 2015, 5:02:52 PM7/12/15
to grails-de...@googlegroups.com
Hi thanks for getting back to me, I have fixed the issue it turned out to be spaces and/or consecutive capital letters in the project name

System info for completeness:
Windows 7
GGTS 3.6.4
JDK 1.7.0_79

Not sure about forked mode I am using the default new project fork setting run: [maxMemory: 768, minMemory: 64, debug: false, maxPerm: 256, forkReserve:false],

cheers

Abir Basu

unread,
Feb 17, 2017, 1:31:54 PM2/17/17
to Grails Dev Discuss
Chris ! Thanks a zillion ! Spared me the horror :)

Mércio Filho

unread,
Feb 1, 2019, 8:32:31 AM2/1/19
to Grails Dev Discuss
Thank you! My problem was the name of the app. It was 'grails-web". I think the '-' character caused this problem.
Reply all
Reply to author
Forward
0 new messages