Monday, December 14, 2009

Garils 1.1 1 and Hibernate Plugin 1.1.2 mis smatch

With the update of Grails 1.1.2 and Hibernate plug in 1.1.2. I ran through this error. As my application already was running on grails 1.1.1 so new hibernate plugin ran into compatibility issues.

Error :

plugin hibernate-1.1.2 requires version [1.1.2 > *] of Grails which your current Grails installation does not meet

As i was trying to update the plugins from Intellij idea. So it kept on downloading the greatest version of Hibernate plugin 1.1.2, even after i selected hibernate 1.1.1 in the drop down. So i tried this alternative way and it worked for me :


1. before doing a run-app, run following command

grails install-plugin hibernate 1.1.1

in the application root folder

then, once the plugin is installed, do a grails run-app

2. there is one more way for workaround to this issue.


download and bundle the hibernate-1.1.1 plugin within the application by adding something like:

grails.plugin.location.hibernate = './plugins/hibernate-1.1.1' to the grails-app/conf/BuildConfig.groovy


3. Third way is to upgrade your grails to 1.1.2


Hope this helps.

Thursday, May 21, 2009

Spring scheduling provides the easy configurable way for Cron jobs/ Schdulers.

1. myJobClass refers to the bean which refers to myJobClass.java (Actual job to be scheduled). UserDAO is injected to the MyJobClass. Spring scheduling is so far not in the picture i.e. loosely coupling

2. myBeanJobDetail is the bean which actually calls spring scheduling API. You need to set properties which are again Injected to spring beans on runtime.

3.Cron Trigger is the bean where you actually make your job a full blown trigger by setting up the triggering time.






Though this is a simple way of doing things but we can independently use Quartz API for scheduling. I will refer to that approach in my next blog.