Grails Compile/HotDeploy Issue Since 8.1.2 Upgrade

You've probably all experienced the JAVA_HOME issue and a workaround is in place for that. (See http://www.jetbrains.net/devnet/message/5238484#5238484)

However another unpleasant behavior has surfaced: my changes are not being automatically Grails compiled and hot deployed. After launching a Grails web app, if I edit a GSP, domain class, controller, etc., the changes are not reflected in the app when I do a page refresh.

If I manually run Tools | Run Grails Target and force a Grails compile, then the changes are hot deployed. Also, if I do a Grails compile from outside IDEA, the changes are compiled and hotdeployed. And of course, if I restart the server the changes are there.

I don't remember making any configuration changes that would cause this, and can't find any to make that will fix it. This is really harshing my mellow!

Any suggestions on what to configure to restore automatic Grails compile/hotdeploy on making a Grails code change in IDEA?

Thanks.

Jack

2 comments
Comment actions Permalink

Please check your Grails run configuration, there are settings which may
affect hot deploy, like -DrecompileFreq. Besides, please ensure that
auto-save is enabled in your General IDE settings.

0
Comment actions Permalink

Peter,

Thanks for your answer. I checked the run configuration for a setting that might be affecting this, but found nothing obvious. However, think I've found the (Grails) cause as to why the views are not being hot deployed.

When I start the app in development mode, I see this warning in the console output:

view.ScaffoldingViewResolver View caching is SWITCHED OFF -- DEVELOPMENT SETTING ONLY: This can severely impair performance

However, when I start in another mode, I don't see that warning. This implies view chaching is turned on by Grails for other runtime environments.

The environment I'm running under is a special development mode I use to mock out PayPal web service callbacks, which is different from my development environment where I actually make calls to the PayPal sandbox. However, it looks like Grails is "helping" me by turning on view caching.

In other words, instead of using logic like this: if(GrailsUtil.environment != 'production') { // turn caching on ... }

Grails must be coded like this: if(GrailsUtil.environment == 'development') { // turn caching off ... }

thus enabling caching in all runtime environments except development. I'm not yet sure where this is happening in Grails, but will recommend a change once I find out where it's happening.

As to other hot deploy issues, I may have misread the symptoms. It looks like changed Command classes are never getting hotdeployed under 'development' or any runtime mode, but other classes are.

0

Please sign in to leave a comment.