Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 2.0 final
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
Environment:Windows 7 Professional 64-bit
intel i3-2310M CPU @ 2.10GHz
4.00GB RAM
Java JDK 1.6.0_26 64-bit
Description
This is an issue in Grails 2.0.0 running on Windows 7 64-bit.
Whenever I make any change in a controller class, the code reload does not work (the change does not take effect) even though in the console, it says "Compiling 2 source files." I need to restart my local grails instance to let the new change take effect.
I tested this on my other laptop running on Mac OS X Lion, and it does NOT have the same issue. So it must be something related to Windows-specific.
I have included a sample project that has a bare-bones Model class and controller with its scaffolded views. I added one line of code (log.info statement) in the list method of BookController.groovy.
To reproduce:
1) on Windows 7, unzip the reload-fail.zip
2) run grails-app in command line
3) once server is up, go to http://localhost:8080/reload-fail/book/list in browser
4) in the local server console log, you will see a log message with "INFO fail.BookController - in list method."
5) change line 14 in grails-app/controllers/reload/fail/BookController.groovy to be: log.info("in list method.2")
6) save the change in the controller.
7) reload http://localhost:8080/reload-fail/book/list in browser
8) local server console log still displays "INFO fail.BookController - in list method." and not "INFO fail.BookController - in list method.2"
-
Hide
- reload-fail.zip
- 03/Jan/12 7:34 AM
- 755 kB
- Myong Chong
-
- reload-fail/.classpath 4 kB
- reload-fail/.project 0.9 kB
- reload-fail/.../org.codehaus.groovy.eclipse.preferences.prefs 0.1 kB
- reload-fail/.../org.eclipse.core.resources.prefs 1 kB
- reload-fail/.../org.eclipse.wst.common.project.facet.core.xml 0.1 kB
- reload-fail/application.properties 0.1 kB
- reload-fail/.../ApplicationResources.groovy 0.1 kB
- reload-fail/grails-app/.../BootStrap.groovy 0.1 kB
- reload-fail/.../BuildConfig.groovy 2 kB
- reload-fail/grails-app/.../Config.groovy 4 kB
- reload-fail/grails-app/.../DataSource.groovy 1 kB
- reload-fail/grails-app/.../resources.groovy 0.0 kB
- reload-fail/.../UrlMappings.groovy 0.2 kB
- reload-fail/.../BookController.groovy 3 kB
- reload-fail/grails-app/.../fail/Book.groovy 0.1 kB
- reload-fail/.../messages.properties 3 kB
- reload-fail/.../messages_cs_CZ.properties 3 kB
- reload-fail/.../messages_da.properties 3 kB
- reload-fail/.../messages_de.properties 4 kB
- reload-fail/.../messages_es.properties 3 kB
- reload-fail/.../messages_fr.properties 2 kB
- reload-fail/.../messages_it.properties 2 kB
- reload-fail/.../messages_ja.properties 4 kB
- reload-fail/.../messages_nl.properties 3 kB
- reload-fail/.../messages_pt_BR.properties 3 kB
- reload-fail/.../messages_pt_PT.properties 3 kB
- reload-fail/.../messages_ru.properties 4 kB
- reload-fail/.../messages_sv.properties 3 kB
- reload-fail/.../messages_th.properties 6 kB
- reload-fail/.../messages_zh_CN.properties 2 kB
Issue Links
- relates to
-
GRAILS-7936
Grails command line not handling blanks in Windows
-
-
GRAILS-8914
DirectoryWatcher and GrailsProjectWatcher in windows treat all GSP files as new after startup
-
Activity
- All
- Comments
- Work Log
- History
- Activity
- Git Commits
I have the same problem on Windows XP. Reload works ok for a FEW changes and then just stops picking up changes. Source code changes will show up on the Exception web page though. Have seen this for changes to Controllers and Services - not sure if I have seen it for changes to groovy/java classes.
Its quite annoying. Tried to download grails source to see why but gradle doesnt like me either.
Also seems like if an exception/compilation error will stop reloading too. Any ideas of what debugging could help would be appreciated. Checked the source code and found Directory watcher but it has no logging in it from what I could see.
Same here with but with Ubuntu. The reload in that project worked before, but out of the sudden it stopped reloading the changes. Other Grails 2.0 projects still work wonderful.
Kernel:
Linux nnifPad 3.0.0-15-generic #26-Ubuntu SMP Fri Jan 20 17:23:00 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
Java:
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02, mixed mode)
If someone can attach an example project that exhibits the problem with steps to reproduce we can take a look
Hi! I have similar issues. Work on Windows 7 Professional and Ultimate, x64.
Please, fix it ASAP because development is hell.
How are you running the application? Please could someone try some of the following scenarios:
grails run-app
Does it work? If not try:
grails
Then from interactive mode:
grails> run-app
Does it work?
Could someone also check from the home screen whether "Reloading Enabled" is true under the "Application Status" for a new app.
For me this way is only working, when doing "compile" manually. Then all changes are applied (although taglib changes are not reflected and new controller actions are not accessible without restart). Where is "reloading enabled" configured?
I just started the app using:
grails grails> run-app
However, it says: "Reloading active: true". But in groovy files (controllers, etc) are not reflected. Changes in GSP files ARE reflected.
Ok, I had some very weird IntelliJ caching problems causing this problem. So everything is fine for me and my Ubuntu now.
@Graeme: your suggestion worked for me.
The following works:
grails
then from interactive mode,
grails> run-app
and the "Reloading active" is true.
However,
grails run-app
gives "Reloading active" as false.
Interesting thing is that my changes in .gsp files are reloaded when doing "grails run-app" but my controller changes are not reloaded.
@Myong - That is good to know, it is strange I cannot reproduce the problem of the reloading not being active when using "grails run-app"
Today reloading on my project start to work correctly. Maybe it related to bug that we fix - package declared in class was not corresponding to folder where class was stores. In Grails 1.3.7 this case is trigger infinite recompilation and OutOfMemory.
I guess some issues here are directly related with: http://jira.grails.org/browse/GRAILS-8914
I can confirm the error.
We have 6 PC's running various versions of Windows 7 and 5 PC's running Ubuntu 12.04.
On the windows machines in "run-app" reloading works (some of the time) for controllers, but never works for services injected on the controllers. Nothing is reloaded when running "test-app" in interactive mode.
"run-app" from interactive mode cahnges nothing.
On the Ubuntu machines everything works like a charm.
Pretty please with sugar on top, fix this!
/brian
same here. windows 7 grails 2.1.1 oracle jdk 7 intellij 11. i'll have my project done in months instead of weeks, the search just begun.
I'm having the same problem on a Mac running 10.8.2 (Mountain Lion, I think). Domain (changes) and controllers (new one) definitely not reloading. Exiting server does not fix. Need to exit from command line and restart the agent completely to get the changes to appear.
Running 2.1.1 grails, app created new. Will try to show to Grails guys at SpringSource if I can find them.
Same issue on Mint Linux. I don't think the OS probably matters, from what I've seen above.
The commands I'm using:
$ grails
<starts grails>
grails> dev run-app
JDK 1.6.0_30
grails 2.1.0
It worked OK for a while, but now it has stopped seeing my changes. I have no idea what I might have changed, if anything, that caused it to stop working. If I can isolate a particular factor, I will be sure to post it here.
I figured out the difference between when it works and when it doesn't work, on my system:
FAIL:
If I start up grails FIRST, then say 'dev run-app' it doesn't work. It doesn't notice when files have changed, to recompile them.
SUCCESS:
If I run it by saying (all on one command line from the shell):
grails dev run-app
the automatic recompile starts working again.
Hope this helps.
@miles you saved my life man ! thank you.
(I was running grails in debug mode with IntelliJ Idea .. )
By the way I just had the same issue after upgrading from grails 2.1.0 to 2.2.0 well I upgraded the resources too to 1.2.RC but I don't think that's the problem.
I'm on Windows 7 / JDK 1.7.0_70 / Grails 2.2.0
Fyi, I tried the attached project with the following setup and the reload worked and the new log message was displayed.