9

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

Marco
  • 12,916
  • 27
  • 97
  • 162

2 Answers2

5

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.

Brad Mace
  • 26,280
  • 15
  • 94
  • 141
0

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
Vinay Prajapati
  • 6,025
  • 4
  • 36
  • 75
  • Thanks for your reply, but also this does not solve the problem. – Marco Apr 19 '15 at 12:33
  • Your question heading misguided me. So your controller is getting compiled. But page not found 404 is due to the view it is trying to render is not present? What are the details your newly created controller contains? Is it scaffolded? Please find corresponding views or put a render "hello world! " to test – Vinay Prajapati Apr 19 '15 at 14:03
  • If the view is missing you will get an HTTP 500 error. Giving the message that it can not resolve the view. So concluding i see in the console that the newly controller is created, compiled but inaccessible until i restart the application. – Marco Apr 20 '15 at 05:50
  • I'm working on Grails 2.4.4. tried this a doesn't work. It is doing the same as before: compiling the controller but the changes are not available until restart. – Pablo Pazos Jun 01 '15 at 03:35
  • try grails -reloading run-app for grails 2.4.Also,see link http://grails.org/doc/2.3.x/guide/single.html#upgradingFromPreviousVersionsOfGrails. – Vinay Prajapati Jun 02 '15 at 06:35