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
Related
If I create a new web profile app, and generate-all, it runs fine in my local and deploys without error to JBoss. But when I try to access the app all URLs return 404. I know the app started up successfully, because it created tables in the database.
Here's what I'm doing.
grails 3.1.4> create-app demo
create-domain-class Book
create-domain-class Author
Edit domain classes
generate-all *
change tomcat dependency from compile to provided in build.gradle
change dataSource in application.yml to use my JNDI Oracle connection
Add server: contextPath: /demo to application.yml
run-app -> Works
gradle war
Deploy to JBoss EAP 6.4.0.GA
JBoss says deployment and activation of the app was successful. There are no errors of any sort in any JBoss log file. And dbCreate: update made the DDL changes to my Oracle database, so I know it got that far. But all URLs for the app return 404.
This is a known bug: Issue-9481
It has been added to grails 3.1.5 milestone.
Why does Grails 3.0.9 say it is recompiling my changed files and yet I don't see the changes in the browser?
I created a hello world app in Grails using the official tutorial. When I made a change to the hello world text rendered in HelloController.groovy, I got this message at the Grails console:
grails> File
/home/oge/code/grails-demo/grails-app/controllers/grails/demo/HelloController.groovy
changed, recompiling..
However, refreshing the browser showed no changes. I had to stop the console (Ctrl-C) and then restart the app again with run-app in order for my changes to appear.
FYI Grails 2.5.0 automatically reloads once I change the source files.
I am upgrading an existing Grails 2.2.4 app to 2.5.0.
For some reason, endpoints whose URLs included the app context in 2.2.4 no longer include the app context in 2.5.0.
e.g., for app context = app, old endpoint in 2.2.4 was:
/app/a/b/c
but in 2.5.0 is now:
/a/b/c
I have tried many things to fix this, including:
in application.properties:
app.name=app
app.context=/app
in Config.groovy, for testing on localhost:8080:
grails.app.context = "/${appName}"
grails.serverURL = http://localhost:8080 and grails.serverURL = http://localhost:8080/${appName}, at different times
app.grails.serverURL = http://localhost:8080 and app.grails.serverURL = http://localhost:8080/${appName}, at different times
I've verified that "${appName}" == 'app'.
I have upgraded all of the plugins to the newest version, but I'm continuing to use the resources plugin instead of the asset-pipeline plugin.
I am not using scaffolding.
Any suggestions?
UrlMappings.groovy contained some mappings with (parseRequest:true), which is no longer supported by Grails. Removing that fixed it.
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
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