I am on Grails 2.3.7.
I have a main application called momain, and have created a plugin called motest.
I then in the BuildConfig.groovy add the line:
grails.plugin.location.'motest' = "../motest"
No other references to the plugin has been made. I add a controller to motest and I can render some random text when reached in the browser.
However, when I change the output of the render and hit refresh in the browser, the changes are not reloaded from the code in the plugin! I have to run grails run-app for them to be picked up.
How can I make Grails reload changes for things in the plugin? Otherwise it becomes really tedious to separate functionality to plugins/modules.
Thanks!
EDIT
This seems to occur when I switch from
build ":tomcat:7.0.52.1"
to
build ":jetty:2.0.3"
It seems to be a problem related to jetty...
Related
It looks like IntelliJ's (Ultimate EAP 15) support for Grails 3 is in the early stages yet. If I do Run -> Debug 'Grails:My App', I'm able to launch an app from inside IntelliJ, I can set breakpoints and it works as expected.
If I make changes however, I see in the console that the file is recompiled, but when I hit reload in the browser, I don't see the changes reflected there. I have to stop and restart the app in IntelliJ before I see them. Anyone know how I can get the auto-reloading working?
After chasing this for a week, this post finally provided an explanation.
It's actually a Grails issue, not a problem with IntelliJ's Grails integration: spaces in a file's path will break automatic reloading. Renaming my project from Grails Demo to GrailsDemo got everything straighted out. (Storing a project in a folder like My Documents will also cause trouble.) The post's author indicates that this started with version 2.4.4 and it's still happening for me in 3.0.4.
any number of problems tonight.
I have a grails 3.3.8 app in intellij. I have built some domain classes, and in the ide I selected the domain classes and told it to generate the controllers, which it does.
if i right click the Application project in project browser (either to run debug) the app comes up but no controllers are loaded. so i have to cease the session.
if i open gradle view and issue the bootRun command the app starts and the controllers get loaded!
however if i right click on the boot run action and select debug, if disappears off into the ether on a background thread and the IDE never fires and i dont get control of the debug session in the IDE.
This has got terribly frustrating and i've burn't alot of time tonight going round in circles
does anyone know why the right click on Application, in project explorer, fails to load the controllers, whilst bootRun does load them .
If i can fix that - then the debug from the project explorer should work. Its very odd.
i had to try and recreate the project as this evening it got lost telling me my domain classes were no domain classes and when i tried to delete and controllers/services and rebuild them it kept telling me cmdb.$xxxServices gorm data services couldn't be found and refused to build hibernate datastore
you can find the project to look at enter link description here but it needs another project (ticketAdapter to run, and a library project softwoodUtils) i've used the json end points directly on my browser for the ticketAdapter (server) project and i know thats working - its not a grails app itself)
Looks like you are trying to launch a Run/Debug Configuration of a standard Java Application with the public static void main method. For Grails 3 rather use Grails Run/Debug Configuration where specify the Grails module to load and grails command to run the app with:
You can also use gradle actions like bootRun to run your app.id youdouble click a gradle actions from the gradle panel it will automatically create and run a gradle run configuration. Then you can run or debug that configuration.
I am working with Grails 2.4.2 and Tomcat 7 in Debian server.
Suppose I need to change a label of a field. If I change the label in server's view directory it is not working.
All I have to do is creating war again and deploy. But so far as I know, if any changes made in views no need to create war and deploy again.
In my opinion, the best way to deal with any dynamic content is to externalize it. Save the dynamic content into an external file where you can modify it. Grails' reloadable configuration could be of a great help. See http://www.tothenew.com/blog/externalize-and-reload-grails-configuration-dynamically/ to get an idea how this could be done.
I have ggts-bundle bundle 3.6.1 64 bit with JDK 7 (jdk1.7.0_67) on Win7 64bit.
I have grails home setup as GRAILS_HOME and grails version grails-2.4.3.
When i create a new action/method in the controller class in the tool suite and hit save and refresh the browser, it doesn't reload the changes in the application.
I even modified BuildConfig.groovy and added the following
grails.reload.enabled = true
I also tried with grails -reloading run-app
Nothing seem to reload the changes, I have to stop the server and restart it and then
it reflects the changes.
I am sure there's something i can do to have it reload the app.
I read online and tried other suggestion in questions on stackoverflow before i posted this.
Any suggestions.
Did you end up getting a solution to this?
I've just tried this out in GGTS and it looks like there is no problem.
Version: 3.6.3.RELEASE
Build Id: 201411281415
Platform: Eclipse Luna SR1 (4.4.1)
OS: Win7 64bit
I'm working on a plain vanilla (unmodified) install with default settings.
Using a simple Grails project, with a simple HelloController.groovy and a couple of GSPs... corresponding to two methods inside the controller. Launch the server...
Tried out two scenarios to see what happened, back in the IDE...
modify some simple output text in one of the GSPs, save, refresh the browser... yep, no problem, the change shows up
modify the HelloController.groovy to tell one of the methods to use a different GSP, save, refresh the browser... again, no problems, the change is reflected.
Note. I did have to wait a few seconds in scenario 2 for the IDE to notice the change and to recompile
Perhaps try updating your instance of GGTS to the latest release to see if that makes a difference?
Hope this helps.
When I invoke run-app in the Grails console, code changes are auto-detected, and a recompile is triggered.
But when I change conf/UrlMappings.groovy, even though I see "Compiling 1 source files" appear in the console, the live web server doesn't, in fact, update its behavior.
The problem appears specific to UrlMappings.groovy; for example, I can make changes to a controller class and they appear automatically when I hit "refresh" in the browser.
Any thoughts on what's causing this behavior and how I can fix it?
Thanks!