Grails 3 does not auto reload changes in my app - grails

I'm starting with grails 3 using the Intelijdea IDE but I'm having a problem and it's that when I'm in development stage my app does not auto reload the changes made which I find a bit problematic ..
If anyone knows please help me with that problem.

I'm using grails 3.3.9 and had the same problem until I tried running my app with:
gradlew bootRun
And it worked!!

I am currently using grails 3.2.4 and auto reloading works fine. Only thing I noticed is that sometimes new methods don't get reloaded properly and will require a restart.
Maybe posting your exact grails and environment , version and details will help.

Related

How do I keep the spring-security-core login screen when using the spring-security-ui plugin

I am migrating a grails app from 2.3.4 to 3.3.9. I created a new app and am bringing in the code piece by piece. I have the "org.grails.plugins:spring-security-core:3.2.3" dependency and "org.grails.plugins:spring-security-ui:3.1.2" because I want the user/role management screens.
From my investigation both plugins include login/auth.gsp, and it seems my app is using ui instead of core, but this is not how my 2.3.4 app behaved using ":spring-security-core:2.0-RC2" and ":spring-security-ui:1.0-RC1". Is there some way to configure or force the app to use login/auth.gsp from core? If not, can I just copy the one I want into my local views folder? Would there be any compatibility issues?
I copied https://github.com/grails-plugins/grails-spring-security-core/blob/3.2.x/grails-app/views/login/auth.gsp into my views folder, and it seems to work fine and give me the results I want. There seem to be no obvious compatibility issues.

grails dbm-gorm-diff is updating db

I'm using grails database-migration to update my production db, but it' presenting a weird behaviour. I ran dbm-gorm-diff and it seems to work fine, but for some reason my prod db is getting updated without I use 'dbm-update' or put it to be executed when the war file is deployed.
What I realised so far is that it seems that any operation made on the prod environment is some how triggering an update on the db. And I couldn't figure out what.
did you set dataSource -> dbCreate to 'any other value'?
I highly doubt that this is what's happening; that would be a very serious bug, and it would have appeared before now, unless it's a very unusual combination of settings/state/db/etc. that triggers this.
If you can isolate this to a small and repeatable example please create a bug report at https://jira.grails.org/browse/GPDATABASEMIGRATION and I'll fix it ASAP.

Weceem plugin not rendering javascript -Grails 2.3.7

I just got weceem-plugin (1.2) installed with Grails 2.3.7. Everything runs fine except javascript does not get rendered - it just shows up as raw text. I have confirmed all the static resources(css,images,js) are loaded. Thanks in advance.
I solved it. I rebuilt the plugin with the grails version I was using. Basically downloaded a copy from github, edited the dependencies to reflect the versions that my grails version comes with by default. It runs fine now - i hope it helps someone.
The problem can be solved without rebuilding existed plugin. You can try to update your Config.groovy in your application. Please, check the demo application for Weceem on GitHub, here you can find Config.groovy https://github.com/jCatalog/weceem-app/blob/master/grails-app/conf/Config.groovy . The application is on grails-2.3.7. Especially check setting:
grails.resources.adhoc.excludes = ['/plugins/weceem-1.2']
also such your settings as
grails.views.default.codec= "none"
grails.views.gsp.codecs.scriptlet = "none"

Grails Data Base Migration - dbm-gorm-diff is not working

I am using Grails 2.3.5 with database migration plugin in new project for understand how it is working. But sometimes dbm-gorm-diff provide empty changelog file,even changes is there.
For example,
i have the person domain class with out any properties.
When initially creating change log, it will create 2 fields id and version in change log.
After that, added 2fields name,age into that person class. then did dbm-update and dbm-gorm-diff that give like following.
databaseChangeLog = {
}
Sometimes gives the changes. some times is not working. Please help me. Why it is working like that. Sorry for bad english.
Using the following tutorial works for me. Make sure you remove dbCreate from your DataSource.groovy. According to the tutorial the workflow is as follows:
Setup
Remove dbCreate from DataSource.groovy
Initially run grails dbm-generate-gorm-changelog changelog.groovy
Sync the changelog with your db by running grails dbm-changelog-sync
Changing domain
Change domain class
Run grails dbm-gorm-diff <your-filename>.groovy --add
Run grails dbm-changelog-sync
Hope this helps
I have spent some time searching for the answer to this same issue.
Caveat: I am using the Grails interactive shell to issue commands, including the dbm-* commands.
By brute force alone, I have come to the conclusion that the domain classes are not reliably reloading. To get consistent results (especially with the generation of new changeLog files), any time I modify a domain class, I stop and restart the Grails interactive shell before calling dbm-gorm-diff. I've tried issuing other commands like clean, compile, package and refresh-dependencies and they just aren't working, and the -reloading flag at the start up of the Grails interactive shell doesn't seem to make any difference either.
Restarting the Grails interactive shell, however, does seem to work reliably, thought it galls me to do so :)
Those who do not use the interactive shell should not be having this problem since the domain classes are loaded with every command call.
This blog has detailed step by step explanation, specially Migrating old databases section helped us in migrating successfully.

Use JBoss with IntelliJ for creating Grails apps

I want to run my grails apps from intelliJ on JBoss-5.1.0.GA installed locally on my machine.
If somebody has any experience please share.
Thanks,
p.s. The aim is to simulate different production enivronments (development,Staging & test)
After a lot of research and going throught Grails FAQ's and other sites I was able to deploy and run my Grails app on a JBoss-5.1.0.GA server installed locally on my machine. The only thing that requires confiruing is:
comment out the WarClassLoaderDeployer bean inside JBOSS_HOME/server/default/deployers/jbossweb.deployer/META-INF/war-deployers-jboss-beans.xml
and that should be it.
Waz
Thanks so much for the answer.. I was breaking my head for many days and hours on how to get grails working on jboss5.
I found a similar answer here.. but yours was right on the head... thanks again.
http://jira.codehaus.org/browse/GRAILS-5606?focusedCommentId=212135&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_212135

Resources