<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6203993754213672453</id><updated>2024-09-06T17:20:10.573-07:00</updated><category term="SES amazon grails aws plugin"/><category term="grails JSON multipart upload"/><title type='text'>Spring and Grails Musings</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://springandgrailsmusings.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6203993754213672453/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://springandgrailsmusings.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>trbala(Bala Thiruppanambakkam)</name><uri>http://www.blogger.com/profile/05837199969474593390</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>14</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6203993754213672453.post-7273021653454453773</id><published>2012-12-26T22:35:00.002-08:00</published><updated>2012-12-26T22:38:22.642-08:00</updated><title type='text'>Install Sqoop and Hbase on macbook pro OS X 10.8.2</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Apache Sqoop helps transfer data between hadoop and datastores(such as relational databases like oracle, db2 and a bunch of others). Read more about sqoop here&lt;br /&gt;
&lt;a href=&quot;http://sqoop.apache.org/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://sqoop.apache.org/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
If you are just getting started with hadoop you may want to refer to my earlier posts regarding installing hadoop:&lt;br /&gt;
&lt;a href=&quot;http://springandgrailsmusings.blogspot.com/2012/12/install-hadoop-111-on-macbook-pro-os-x.html&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://springandgrailsmusings.blogspot.com/2012/12/install-hadoop-111-on-macbook-pro-os-x.html&lt;/a&gt;&lt;br /&gt;
and installing hive:&lt;br /&gt;
&lt;a href=&quot;http://springandgrailsmusings.blogspot.com/2012/12/installing-hive-on-on-macbook-pro-os-x.html&quot; target=&quot;_blank&quot;&gt;http://springandgrailsmusings.blogspot.com/2012/12/installing-hive-on-on-macbook-pro-os-x.html&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
As I mentioned in my previous posts, homebrew provides a simple way to install anything, in this case, sqoop.&lt;br /&gt;
&lt;br /&gt;
Open a terminal and install sqoop with this command:&lt;br /&gt;
brew install sqoop&lt;br /&gt;
&lt;br /&gt;
Homebrew takes care of installing all related dependencies for you, which for sqoop are, hbase and zookeeper.&lt;br /&gt;
&lt;br /&gt;
&lt;iframe bordercolor=&quot;#000000&quot; frameborder=&quot;0&quot; height=&quot;200&quot; hspace=&quot;0&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; scrolling=&quot;no&quot; src=&quot;http://ad.doubleclick.net/adi/N7433.148119.BLOGGEREN/B6533661.1104;sz=200x200;ord=[timestamp]?;lid=41000613802463918;pid=65239;usg=AFHzDLtNiXr7N4U8oaMmn-2Agt5IFoSw3w;adurl=http%253A%252F%252Fwww.abt.com%252Fproduct%252F65239%252FApple-MD523LLA.html;pubid=608570;imgsrc=http%3A%2F%2Fcontent.abt.com%2Fmedia%2Fimages%2Fproducts%2FBDP_Images%2Fbig_MD522LLA.jpg;width=148;height=200&quot; vspace=&quot;0&quot; width=&quot;200&quot;&gt;&lt;/iframe&gt;&lt;br /&gt;
&lt;br /&gt;
Your terminal output should be similar to this:&lt;br /&gt;
&lt;br /&gt;
$ brew install sqoop&lt;br /&gt;
==&amp;gt; Installing sqoop dependency: hbase&lt;br /&gt;
==&amp;gt; Downloading http://www.apache.org/dyn/closer.cgi?path=hbase/hbase-0.94.2/hbase-0.94.2.tar.gz&lt;br /&gt;
==&amp;gt; Best Mirror http://www.poolsaboveground.com/apache/hbase/hbase-0.94.2/hbase-0.94.2.tar.gz&lt;br /&gt;
######################################################################## 100.0%&lt;br /&gt;
==&amp;gt; Caveats&lt;br /&gt;
Requires Java 1.6.0 or greater.&lt;br /&gt;
&lt;br /&gt;
You must also edit the configs in:&lt;br /&gt;
&amp;nbsp; /usr/local/Cellar/hbase/0.94.2/libexec/conf&lt;br /&gt;
to reflect your environment.&lt;br /&gt;
&lt;br /&gt;
For more details:&lt;br /&gt;
&amp;nbsp; http://wiki.apache.org/hadoop/Hbase&lt;br /&gt;
==&amp;gt; Summary&lt;br /&gt;
/usr/local/Cellar/hbase/0.94.2: 3086 files, 115M, built in 3.9 minutes&lt;br /&gt;
==&amp;gt; Installing sqoop dependency: zookeeper&lt;br /&gt;
==&amp;gt; Downloading http://www.apache.org/dyn/closer.cgi?path=zookeeper/zookeeper-3.4.5/zookeeper-3.4.5.tar.gz&lt;br /&gt;
==&amp;gt; Best Mirror http://www.fightrice.com/mirrors/apache/zookeeper/zookeeper-3.4.5/zookeeper-3.4.5.tar.gz&lt;br /&gt;
######################################################################## 100.0%&lt;br /&gt;
/usr/local/Cellar/zookeeper/3.4.5: 193 files, 12M, built in 18 seconds&lt;br /&gt;
==&amp;gt; Installing sqoop&lt;br /&gt;
==&amp;gt; Downloading http://apache.mirror.iphh.net/sqoop/1.4.2/sqoop-1.4.2.bin__hadoop-1.0.0.tar.gz&lt;br /&gt;
######################################################################## 100.0%&lt;br /&gt;
==&amp;gt; Caveats&lt;br /&gt;
Hadoop, Hive, HBase and ZooKeeper must be installed and configured&lt;br /&gt;
for Sqoop to work.&lt;br /&gt;
==&amp;gt; Summary&lt;br /&gt;
/usr/local/Cellar/sqoop/1.4.2: 60 files, 4.4M, built in 24 seconds&lt;br /&gt;
&lt;br /&gt;
&lt;iframe bordercolor=&quot;#000000&quot; frameborder=&quot;0&quot; height=&quot;200&quot; hspace=&quot;0&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; scrolling=&quot;no&quot; src=&quot;http://ad.doubleclick.net/adi/N7433.148119.BLOGGEREN/B6535994.1425;sz=200x200;ord=[timestamp]?;lid=41000613802464048;pid=23496423;usg=AFHzDLtHBO_MHmkFIPQd-SkruU90bKrvWw;adurl=http%253A%252F%252Fwww.officemax.com%252Foffice-supplies%252Fbreakroom-cleaning%252Fbreakroom-supplies%252Fcandy-snacks%252Fchocolate-candy%252Fproduct-prod4220588%253Fcm_mmc%253DPerformics-_-Office%252520Supplies-_-Breakroom%252520and%252520Cleaning-_-Breakroom%252520Supplies%2526ci_src%253D14110944%2526ci_sku%253D23496423;pubid=608570;imgsrc=http%3A%2F%2Fwww.officemax.com%2Fcatalog%2Fimages%2F397x353%2F23496423i_01.jpg;width=200;height=177&quot; vspace=&quot;0&quot; width=&quot;200&quot;&gt;&lt;/iframe&gt;&lt;br /&gt;
&lt;br /&gt;
Now you are all set to use sqoop to work with any supported data store.&lt;br /&gt;
Have fun.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://springandgrailsmusings.blogspot.com/feeds/7273021653454453773/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://springandgrailsmusings.blogspot.com/2012/12/install-sqoop-and-hbase-on-macbook-pro.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6203993754213672453/posts/default/7273021653454453773'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6203993754213672453/posts/default/7273021653454453773'/><link rel='alternate' type='text/html' href='http://springandgrailsmusings.blogspot.com/2012/12/install-sqoop-and-hbase-on-macbook-pro.html' title='Install Sqoop and Hbase on macbook pro OS X 10.8.2'/><author><name>trbala(Bala Thiruppanambakkam)</name><uri>http://www.blogger.com/profile/05837199969474593390</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6203993754213672453.post-6162314750117196491</id><published>2012-12-26T21:38:00.001-08:00</published><updated>2012-12-26T22:41:14.678-08:00</updated><title type='text'>Installing hive 0.9 on macbook pro OS X 10.8.2</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;br /&gt;
If you are reading this post I assume you are interested in getting started with hive on your macbook and already have hadoop installed.&amp;nbsp;For details on installing hadoop please refer to my post here&lt;br /&gt;
&lt;a href=&quot;http://springandgrailsmusings.blogspot.com/2012/12/install-hadoop-111-on-macbook-pro-os-x.html&quot; target=&quot;_blank&quot;&gt;http://springandgrailsmusings.blogspot.com/2012/12/install-hadoop-111-on-macbook-pro-os-x.html&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Again howbrew provides an easy way to get hive on your mac.&lt;br /&gt;
Run this from your mac terminal:&lt;br /&gt;
&amp;gt; brew install hive&lt;br /&gt;
&lt;br /&gt;
You will see brew installs hive on your mac and you will see output similar to the one below:
&lt;br /&gt;
==&amp;gt; Downloading http://www.apache.org/dyn/closer.cgi?path=hive/hive-0.9.0/hive-0.9.0-bin.tar.gz&lt;br /&gt;
==&amp;gt; Best Mirror http://apache.claz.org/hive/hive-0.9.0/hive-0.9.0-bin.tar.gz&lt;br /&gt;
######################################################################## 100.0%&lt;br /&gt;
==&amp;gt; Caveats&lt;br /&gt;
Hadoop must be in your path for hive executable to work.&lt;br /&gt;
After installation, set $HIVE_HOME in your profile:&lt;br /&gt;
&amp;nbsp; export HIVE_HOME=/usr/local/Cellar/hive/0.9.0/libexec&lt;br /&gt;
&lt;br /&gt;
You may need to set JAVA_HOME:&lt;br /&gt;
&amp;nbsp; export JAVA_HOME=&quot;$(/usr/libexec/java_home)&quot;&lt;br /&gt;
==&amp;gt; Summary&lt;br /&gt;
/usr/local/Cellar/hive/0.9.0: 276 files, 25M, built in 13 seconds&lt;br /&gt;
&lt;br /&gt;
Export HIVE_HOME and JAVA_HOME as prompted from your terminal&lt;br /&gt;
&lt;br /&gt;
export HIVE_HOME=/usr/local/Cellar/hive/0.9.0/libexec&lt;br /&gt;
export JAVA_HOME=&quot;$(/usr/libexec/java_home)&quot;&lt;br /&gt;
&lt;br /&gt;
Now you can start hive as follows:&lt;br /&gt;
&lt;br /&gt;
/usr/local/Cellar/hive/0.9.0/bin/hive&lt;br /&gt;
&lt;br /&gt;
&lt;iframe bordercolor=&quot;#000000&quot; frameborder=&quot;0&quot; height=&quot;200&quot; hspace=&quot;0&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; scrolling=&quot;no&quot; src=&quot;http://ad.doubleclick.net/adi/N7433.148119.BLOGGEREN/B6533661.1092;sz=200x200;ord=[timestamp]?;lid=41000613802463918;pid=56830;usg=AFHzDLuRL5C8UGxS0uo9wbByuA9T8e0pCg;adurl=http%253A%252F%252Fwww.abt.com%252Fproduct%252F56830%252FBose-BOSEBT2R.html;pubid=608570;imgsrc=http%3A%2F%2Fcontent.abt.com%2Fmedia%2Fimages%2Fproducts%2FBDP_Images%2Fbig_BOSEBT2R.jpg;width=200;height=108&quot; vspace=&quot;0&quot; width=&quot;200&quot;&gt;&lt;/iframe&gt;&lt;br /&gt;
You should be all set at this point to work with hive.&lt;br /&gt;
Hope this helps.&lt;br /&gt;
&lt;br /&gt;
&lt;iframe bordercolor=&quot;#000000&quot; frameborder=&quot;0&quot; height=&quot;150&quot; hspace=&quot;0&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; scrolling=&quot;no&quot; src=&quot;http://ad.doubleclick.net/adi/N7433.148119.BLOGGEREN/B6533661.1197;sz=180x150;ord=[timestamp]?;lid=41000613802463918;pid=62140;usg=AFHzDLsDLfhf01AdWanl9Hktd3Q-X4EUkA;adurl=http%253A%252F%252Fwww.abt.com%252Fproduct%252F62140%252FApple-MD101LLA.html;pubid=608570;price=%241169.00;title=Apple+MacBook+Pro+2.5G...;merc=Abt+Electronics+%26+Appliances;imgsrc=http%3A%2F%2Fcontent.abt.com%2Fmedia%2Fimages%2Fproducts%2FBDP_Images%2Fbig_MD101LLA.jpg;width=110;height=62&quot; vspace=&quot;0&quot; width=&quot;180&quot;&gt;&lt;/iframe&gt;&lt;iframe bordercolor=&quot;#000000&quot; frameborder=&quot;0&quot; height=&quot;200&quot; hspace=&quot;0&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; scrolling=&quot;no&quot; src=&quot;http://ad.doubleclick.net/adi/N7433.148119.BLOGGEREN/B6533661.1076;sz=200x200;ord=[timestamp]?;lid=41000613802463918;pid=65239;usg=AFHzDLtNiXr7N4U8oaMmn-2Agt5IFoSw3w;adurl=http%253A%252F%252Fwww.abt.com%252Fproduct%252F65239%252FApple-MD523LLA.html;pubid=608570;imgsrc=http%3A%2F%2Fcontent.abt.com%2Fmedia%2Fimages%2Fproducts%2FBDP_Images%2Fbig_MD522LLA.jpg;width=148;height=200&quot; vspace=&quot;0&quot; width=&quot;200&quot;&gt;&lt;/iframe&gt;

&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://springandgrailsmusings.blogspot.com/feeds/6162314750117196491/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://springandgrailsmusings.blogspot.com/2012/12/installing-hive-on-on-macbook-pro-os-x.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6203993754213672453/posts/default/6162314750117196491'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6203993754213672453/posts/default/6162314750117196491'/><link rel='alternate' type='text/html' href='http://springandgrailsmusings.blogspot.com/2012/12/installing-hive-on-on-macbook-pro-os-x.html' title='Installing hive 0.9 on macbook pro OS X 10.8.2'/><author><name>trbala(Bala Thiruppanambakkam)</name><uri>http://www.blogger.com/profile/05837199969474593390</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6203993754213672453.post-7714283988175096096</id><published>2012-12-23T16:33:00.001-08:00</published><updated>2012-12-26T22:43:35.090-08:00</updated><title type='text'>Install Hadoop 1.1.1 on macbook pro OS X 10.8.2</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
I recently installed hadoop on my new Macbook and here is the steps I followed. to get it working.&lt;br /&gt;
I write this with the hope that someone might find this useful.&lt;br /&gt;
&lt;br /&gt;
First up there a couple of very nice posts regarding this which helped me get this done.&lt;br /&gt;
&lt;a href=&quot;http://ragrawal.wordpress.com/2012/04/28/installing-hadoop-on-mac-osx-lion&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://ragrawal.wordpress.com/2012/04/28/installing-hadoop-on-mac-osx-lion&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://dennyglee.com/2012/05/08/installing-hadoop-on-osx-lion-10-7/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://dennyglee.com/2012/05/08/installing-hadoop-on-osx-lion-10-7/&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://geekiriki.blogspot.com/2011/10/flume-and-hadoop-on-os-x.html&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://geekiriki.blogspot.com/2011/10/flume-and-hadoop-on-os-x.html&lt;/a&gt;&lt;br /&gt;
I mainly followed these three(i mixed steps provided by couple of them) to get my installation working.&lt;br /&gt;
&lt;br /&gt;
First up I used homebrew to install hadoop&lt;br /&gt;
brew install hadoop&lt;br /&gt;
&lt;iframe bordercolor=&quot;#000000&quot; frameborder=&quot;0&quot; height=&quot;200&quot; hspace=&quot;0&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; scrolling=&quot;no&quot; src=&quot;http://ad.doubleclick.net/adi/N7433.148119.BLOGGEREN/B6535994.1428;sz=200x200;ord=[timestamp]?;lid=41000613802464048;pid=22973221;usg=AFHzDLshYRgfiW_JOCKa-9XSX7DRt_wMJQ;adurl=http%253A%252F%252Fwww.officemax.com%252Ftechnology%252Fdigital-cameras-camcorders-accessories%252Fdigital-slrs%252Fproduct-prod3360528%253Fcm_mmc%253DPerformics-_-Technology-_-Digital%252520Cameras%252C%252520Camcorders%252520and%252520Accessories-_-Digital%252520SLRs%2526ci_src%253D14110944%2526ci_sku%253D22973221;pubid=608570;imgsrc=http%3A%2F%2Fwww.officemax.com%2Fcatalog%2Fimages%2F397x353%2F22973221i_01.jpg;width=200;height=177&quot; vspace=&quot;0&quot; width=&quot;200&quot;&gt;&lt;/iframe&gt;&lt;br /&gt;
I enabled Remote Login on my mac and created a rsa key using ssh-keygen&lt;br /&gt;
Finally I tested I was able to ssh, by doing ssh localhost.&lt;br /&gt;
I used rsa but dsa can be used as well for ssh.&lt;br /&gt;
&lt;br /&gt;
This is how my conf files look(located in &amp;nbsp;/usr/local/Cellar/hadoop/1.1.1/libexec/conf folder)&lt;br /&gt;
The links provided above detail these-I have not added any changes of my own except for the hadoop install dir change.&lt;br /&gt;
&lt;br /&gt;
&lt;iframe bordercolor=&quot;#000000&quot; frameborder=&quot;0&quot; height=&quot;200&quot; hspace=&quot;0&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; scrolling=&quot;no&quot; src=&quot;http://ad.doubleclick.net/adi/N7433.148119.BLOGGEREN/B6533661.1102;sz=200x200;ord=[timestamp]?;lid=41000613802463918;pid=60184;usg=AFHzDLtvf4Fg57cfhhGaOY8GSdPQM_DJMg;adurl=http%253A%252F%252Fwww.abt.com%252Fproduct%252F60184%252FApple-MD199LLA.html;pubid=608570;imgsrc=http%3A%2F%2Fcontent.abt.com%2Fmedia%2Fimages%2Fproducts%2FBDP_Images%2Fbig_MD199LLA.jpg;width=200;height=200&quot; vspace=&quot;0&quot; width=&quot;200&quot;&gt;&lt;/iframe&gt;&lt;br /&gt;
&lt;br /&gt;
core-site.xml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;?xml version=”1.0″?&amp;gt;&lt;br /&gt;
&amp;lt;?xml-stylesheet type=”text/xsl” href=”configuration.xsl”?&amp;gt;&lt;br /&gt;
&amp;lt;!– Put site-specific property overrides in this file. –&amp;gt;&lt;br /&gt;
&amp;lt;configuration&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;property&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;name&amp;gt;hadoop.tmp.dir&amp;lt;/name&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;value&amp;gt;/usr/local/Cellar/hadoop/hdfs/tmp&amp;lt;/value&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;description&amp;gt;A base for other temporary directories.&amp;lt;/description&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;/property&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;property&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;name&amp;gt;fs.default.name&amp;lt;/name&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;value&amp;gt;hdfs://localhost:9000&amp;lt;/value&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;/property&amp;gt;&lt;br /&gt;
&amp;lt;/configuration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note:Had to create two folders as the original poster indicates like this&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
mkdir /usr/local/Cellar/hadoop/hdfs&lt;br /&gt;
mkdir /usr/local/Cellar/hadoop/hdfs/tmp&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
hdfs-site.xml&lt;br /&gt;
&lt;br /&gt;
&amp;lt;?xml version=”1.0″?&amp;gt;&lt;br /&gt;
&amp;lt;?xml-stylesheet type=”text/xsl” href=”configuration.xsl”?&amp;gt;&lt;br /&gt;
&amp;lt;!– Put site-specific property overrides in this file. –&amp;gt;&lt;br /&gt;
&amp;lt;configuration&amp;gt;&lt;br /&gt;
&amp;lt;property&amp;gt;&lt;br /&gt;
&amp;lt;name&amp;gt;dfs.replication&amp;lt;/name&amp;gt;&lt;br /&gt;
&amp;lt;value&amp;gt;1&amp;lt;/value&amp;gt;&lt;br /&gt;
&amp;lt;/property&amp;gt;&lt;br /&gt;
&amp;lt;/configuration&amp;gt;&lt;br /&gt;
&amp;nbsp;NOTE:change dfs.replication according to your needs.&lt;br /&gt;
&lt;br /&gt;
&lt;iframe bordercolor=&quot;#000000&quot; frameborder=&quot;0&quot; height=&quot;200&quot; hspace=&quot;0&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; scrolling=&quot;no&quot; src=&quot;http://ad.doubleclick.net/adi/N7433.148119.BLOGGEREN/B6533661.1101;sz=200x200;ord=[timestamp]?;lid=41000613802463918;pid=64665;usg=AFHzDLupR6BtolGPoDf7Vcl0usaSsF1Y8g;adurl=http%253A%252F%252Fwww.abt.com%252Fproduct%252F64665%252FApple-ME178LLA.html;pubid=608570;imgsrc=http%3A%2F%2Fcontent.abt.com%2Fmedia%2Fimages%2Fproducts%2FBDP_Images%2Fbig_ME178LLA.jpg;width=175;height=200&quot; vspace=&quot;0&quot; width=&quot;200&quot;&gt;&lt;/iframe&gt;&lt;br /&gt;
&lt;br /&gt;
mapred-site.xml&lt;br /&gt;
&lt;br /&gt;
&amp;lt;?xml version=”1.0″?&amp;gt;&lt;br /&gt;
&amp;lt;?xml-stylesheet type=”text/xsl” href=”configuration.xsl”?&amp;gt;&lt;br /&gt;
&amp;lt;!– Put site-specific property overrides in this file. –&amp;gt;&lt;br /&gt;
&amp;lt;configuration&amp;gt;&lt;br /&gt;
&amp;lt;property&amp;gt;&lt;br /&gt;
&amp;lt;name&amp;gt;mapred.job.tracker&amp;lt;/name&amp;gt;&lt;br /&gt;
&amp;lt;value&amp;gt;localhost:9010&amp;lt;/value&amp;gt;&lt;br /&gt;
&amp;lt;/property&amp;gt;&lt;br /&gt;
&amp;lt;/configuration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Find the line # export HADOOP_OPTS=-server&lt;br /&gt;
Now add this line&lt;br /&gt;
export HADOOP_OPTS=&quot;-Djava.security.krb5.realm=OX.AC.UK -Djava.security.krb5.kdc=kdc0.ox.ac.uk:kdc1.ox.ac.uk&quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Format the Hadoop Namenode using:&lt;br /&gt;
hadoop namenode -format&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Start Hadoop by running the script:&lt;br /&gt;
/usr/local/Cellar/hadoop/1.1.1/libexec/bin/start-all.sh&lt;br /&gt;
&lt;br /&gt;
Run&lt;br /&gt;
ps ax | grep hadoop | wc -l&lt;br /&gt;
If you see 6 as output you are all set.&lt;br /&gt;
If not check the logs at&lt;br /&gt;
ls /usr/local/Cellar/hadoop/1.1.1/libexec/logs/&lt;br /&gt;
&lt;br /&gt;
Health can be checked at&amp;nbsp;&lt;a href=&quot;http://localhost:50070/dfshealth.jsp&quot; target=&quot;_blank&quot;&gt;http://localhost:50070/dfshealth.jsp&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
You can run an example that is provided like this&lt;br /&gt;
cd /usr/local/Cellar/hadoop/1.1.1/libexec&lt;br /&gt;
Run this command&lt;br /&gt;
hadoop jar /usr/local/Cellar/hadoop/1.1.1/libexec/hadoop-examples-1.1.1.jar pi 10 100&lt;br /&gt;
&lt;br /&gt;
You should see output similar to the following&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Number of Maps &amp;nbsp;= 10&lt;br /&gt;
Samples per Map = 100&lt;br /&gt;
Wrote input for Map #0&lt;br /&gt;
Wrote input for Map #1&lt;br /&gt;
Wrote input for Map #2&lt;br /&gt;
Wrote input for Map #3&lt;br /&gt;
Wrote input for Map #4&lt;br /&gt;
Wrote input for Map #5&lt;br /&gt;
Wrote input for Map #6&lt;br /&gt;
Wrote input for Map #7&lt;br /&gt;
Wrote input for Map #8&lt;br /&gt;
Wrote input for Map #9&lt;br /&gt;
Starting Job&lt;br /&gt;
12/12/23 16:31:00 INFO mapred.FileInputFormat: Total input paths to process : 10&lt;br /&gt;
12/12/23 16:31:00 INFO mapred.JobClient: Running job: job_201212231524_0003&lt;br /&gt;
12/12/23 16:31:01 INFO mapred.JobClient: &amp;nbsp;map 0% reduce 0%&lt;br /&gt;
12/12/23 16:31:04 INFO mapred.JobClient: &amp;nbsp;map 20% reduce 0%&lt;br /&gt;
12/12/23 16:31:06 INFO mapred.JobClient: &amp;nbsp;map 40% reduce 0%&lt;br /&gt;
12/12/23 16:31:08 INFO mapred.JobClient: &amp;nbsp;map 60% reduce 0%&lt;br /&gt;
12/12/23 16:31:09 INFO mapred.JobClient: &amp;nbsp;map 80% reduce 0%&lt;br /&gt;
12/12/23 16:31:11 INFO mapred.JobClient: &amp;nbsp;map 100% reduce 0%&lt;br /&gt;
12/12/23 16:31:12 INFO mapred.JobClient: &amp;nbsp;map 100% reduce 26%&lt;br /&gt;
12/12/23 16:31:18 INFO mapred.JobClient: &amp;nbsp;map 100% reduce 100%&lt;br /&gt;
12/12/23 16:31:19 INFO mapred.JobClient: Job complete: job_201212231524_0003&lt;br /&gt;
12/12/23 16:31:19 INFO mapred.JobClient: Counters: 27&lt;br /&gt;
12/12/23 16:31:19 INFO mapred.JobClient: &amp;nbsp; Job Counters&lt;br /&gt;
12/12/23 16:31:19 INFO mapred.JobClient: &amp;nbsp; &amp;nbsp; Launched reduce tasks=1&lt;br /&gt;
12/12/23 16:31:19 INFO mapred.JobClient: &amp;nbsp; &amp;nbsp; SLOTS_MILLIS_MAPS=16432&lt;br /&gt;
12/12/23 16:31:19 INFO mapred.JobClient: &amp;nbsp; &amp;nbsp; Total time spent by all reduces waiting after reserving slots (ms)=0&lt;br /&gt;
12/12/23 16:31:19 INFO mapred.JobClient: &amp;nbsp; &amp;nbsp; Total time spent by all maps waiting after reserving slots (ms)=0&lt;br /&gt;
12/12/23 16:31:19 INFO mapred.JobClient: &amp;nbsp; &amp;nbsp; Launched map tasks=10&lt;br /&gt;
12/12/23 16:31:19 INFO mapred.JobClient: &amp;nbsp; &amp;nbsp; Data-local map tasks=10&lt;br /&gt;
12/12/23 16:31:19 INFO mapred.JobClient: &amp;nbsp; &amp;nbsp; SLOTS_MILLIS_REDUCES=13728&lt;br /&gt;
12/12/23 16:31:19 INFO mapred.JobClient: &amp;nbsp; File Input Format Counters&lt;br /&gt;
12/12/23 16:31:19 INFO mapred.JobClient: &amp;nbsp; &amp;nbsp; Bytes Read=1180&lt;br /&gt;
12/12/23 16:31:19 INFO mapred.JobClient: &amp;nbsp; File Output Format Counters&lt;br /&gt;
12/12/23 16:31:19 INFO mapred.JobClient: &amp;nbsp; &amp;nbsp; Bytes Written=97&lt;br /&gt;
12/12/23 16:31:19 INFO mapred.JobClient: &amp;nbsp; FileSystemCounters&lt;br /&gt;
12/12/23 16:31:19 INFO mapred.JobClient: &amp;nbsp; &amp;nbsp; FILE_BYTES_READ=226&lt;br /&gt;
12/12/23 16:31:19 INFO mapred.JobClient: &amp;nbsp; &amp;nbsp; HDFS_BYTES_READ=2560&lt;br /&gt;
12/12/23 16:31:19 INFO mapred.JobClient: &amp;nbsp; &amp;nbsp; FILE_BYTES_WRITTEN=267335&lt;br /&gt;
12/12/23 16:31:19 INFO mapred.JobClient: &amp;nbsp; &amp;nbsp; HDFS_BYTES_WRITTEN=215&lt;br /&gt;
12/12/23 16:31:19 INFO mapred.JobClient: &amp;nbsp; Map-Reduce Framework&lt;br /&gt;
12/12/23 16:31:19 INFO mapred.JobClient: &amp;nbsp; &amp;nbsp; Map output materialized bytes=280&lt;br /&gt;
12/12/23 16:31:19 INFO mapred.JobClient: &amp;nbsp; &amp;nbsp; Map input records=10&lt;br /&gt;
12/12/23 16:31:19 INFO mapred.JobClient: &amp;nbsp; &amp;nbsp; Reduce shuffle bytes=280&lt;br /&gt;
12/12/23 16:31:19 INFO mapred.JobClient: &amp;nbsp; &amp;nbsp; Spilled Records=40&lt;br /&gt;
12/12/23 16:31:19 INFO mapred.JobClient: &amp;nbsp; &amp;nbsp; Map output bytes=180&lt;br /&gt;
12/12/23 16:31:19 INFO mapred.JobClient: &amp;nbsp; &amp;nbsp; Total committed heap usage (bytes)=1931190272&lt;br /&gt;
12/12/23 16:31:19 INFO mapred.JobClient: &amp;nbsp; &amp;nbsp; Map input bytes=240&lt;br /&gt;
12/12/23 16:31:19 INFO mapred.JobClient: &amp;nbsp; &amp;nbsp; Combine input records=0&lt;br /&gt;
12/12/23 16:31:19 INFO mapred.JobClient: &amp;nbsp; &amp;nbsp; SPLIT_RAW_BYTES=1380&lt;br /&gt;
12/12/23 16:31:19 INFO mapred.JobClient: &amp;nbsp; &amp;nbsp; Reduce input records=20&lt;br /&gt;
12/12/23 16:31:19 INFO mapred.JobClient: &amp;nbsp; &amp;nbsp; Reduce input groups=20&lt;br /&gt;
12/12/23 16:31:19 INFO mapred.JobClient: &amp;nbsp; &amp;nbsp; Combine output records=0&lt;br /&gt;
12/12/23 16:31:19 INFO mapred.JobClient: &amp;nbsp; &amp;nbsp; Reduce output records=0&lt;br /&gt;
12/12/23 16:31:19 INFO mapred.JobClient: &amp;nbsp; &amp;nbsp; Map output records=20&lt;br /&gt;
Job Finished in 19.303 seconds&lt;br /&gt;
Estimated value of Pi is 3.14800000000000000000&lt;br /&gt;
&lt;br /&gt;
Hope this helps.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://springandgrailsmusings.blogspot.com/feeds/7714283988175096096/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://springandgrailsmusings.blogspot.com/2012/12/install-hadoop-111-on-macbook-pro-os-x.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6203993754213672453/posts/default/7714283988175096096'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6203993754213672453/posts/default/7714283988175096096'/><link rel='alternate' type='text/html' href='http://springandgrailsmusings.blogspot.com/2012/12/install-hadoop-111-on-macbook-pro-os-x.html' title='Install Hadoop 1.1.1 on macbook pro OS X 10.8.2'/><author><name>trbala(Bala Thiruppanambakkam)</name><uri>http://www.blogger.com/profile/05837199969474593390</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6203993754213672453.post-6260036663158804419</id><published>2012-10-04T20:52:00.001-07:00</published><updated>2012-10-10T20:04:53.070-07:00</updated><title type='text'>Using logback and slf4j in grails application</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Recently I configured grails application with logback.&lt;br /&gt;
Logback is better than log4j as mentioned here:&amp;nbsp;&lt;a href=&quot;http://logback.qos.ch/reasonsToSwitch.html&quot;&gt;http://logback.qos.ch/reasonsToSwitch.html&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
The changes to a grails application are these&lt;br /&gt;
&lt;br /&gt;
We need to exclude log4j in buildconfig.&lt;br /&gt;
We can also specify where the logback configuration file is located&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;yui_3_2_0_22_134940651380560&quot; id=&quot;yiv867872189yui_3_2_0_18_134919033193454&quot; style=&quot;font-family: arial, helvetica, sans-serif; font-size: 13px;&quot;&gt;
&lt;span id=&quot;yiv867872189yui_3_2_0_18_134919033193480&quot;&gt;&lt;br class=&quot;Apple-interchange-newline&quot; /&gt;&lt;b&gt;In BuildConfig.groovy&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div id=&quot;yiv867872189yui_3_2_0_18_134919033193454&quot; style=&quot;font-family: arial, helvetica, sans-serif; font-size: 13px;&quot;&gt;
&lt;span id=&quot;yiv867872189yui_3_2_0_18_134919033193492&quot;&gt;&lt;span id=&quot;yiv867872189yui_3_2_0_18_1349190331934109&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div id=&quot;yiv867872189yui_3_2_0_18_134919033193454&quot;&gt;
&lt;span id=&quot;yiv867872189yui_3_2_0_18_134919033193492&quot;&gt;&lt;span id=&quot;yiv867872189yui_3_2_0_18_1349190331934109&quot;&gt;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span id=&quot;yiv867872189yui_3_2_0_18_134919033193492&quot;&gt;&lt;span id=&quot;yiv867872189yui_3_2_0_18_1349190331934109&quot;&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div id=&quot;yiv867872189yui_3_2_0_18_134919033193454&quot;&gt;
&lt;span id=&quot;yiv867872189yui_3_2_0_18_134919033193492&quot;&gt;&lt;span id=&quot;yiv867872189yui_3_2_0_18_1349190331934109&quot;&gt;&amp;nbsp; &amp;nbsp;// inherit Grails&#39; default dependencies&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span id=&quot;yiv867872189yui_3_2_0_18_134919033193492&quot;&gt;&lt;span id=&quot;yiv867872189yui_3_2_0_18_1349190331934109&quot;&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div id=&quot;yiv867872189yui_3_2_0_18_134919033193454&quot;&gt;
&lt;span id=&quot;yiv867872189yui_3_2_0_18_134919033193492&quot;&gt;&lt;span id=&quot;yiv867872189yui_3_2_0_18_1349190331934109&quot;&gt;&amp;nbsp; &amp;nbsp; inherits(&quot;global&quot;) {&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span id=&quot;yiv867872189yui_3_2_0_18_134919033193492&quot;&gt;&lt;span id=&quot;yiv867872189yui_3_2_0_18_1349190331934109&quot;&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div id=&quot;yiv867872189yui_3_2_0_18_134919033193454&quot;&gt;
&lt;span id=&quot;yiv867872189yui_3_2_0_18_134919033193492&quot;&gt;&lt;span id=&quot;yiv867872189yui_3_2_0_18_1349190331934109&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ...&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span id=&quot;yiv867872189yui_3_2_0_18_134919033193492&quot;&gt;&lt;span id=&quot;yiv867872189yui_3_2_0_18_1349190331934109&quot;&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;div id=&quot;yiv867872189yui_3_2_0_18_134919033193454&quot;&gt;
&lt;span id=&quot;yiv867872189yui_3_2_0_18_134919033193492&quot;&gt;&lt;span id=&quot;yiv867872189yui_3_2_0_18_1349190331934109&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // excludes &#39;ehcache&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span id=&quot;yiv867872189yui_3_2_0_18_134919033193492&quot;&gt;&lt;span id=&quot;yiv867872189yui_3_2_0_18_1349190331934109&quot;&gt;
&lt;div id=&quot;yiv867872189yui_3_2_0_18_134919033193454&quot;&gt;
&lt;span class=&quot;yiv867872189Apple-tab-span&quot; id=&quot;yiv867872189yui_3_2_0_18_1349190331934158&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;background-color: yellow;&quot;&gt;excludes &#39;grails-plugin-log4j&#39;&lt;/span&gt;&lt;/div&gt;
&lt;div id=&quot;yiv867872189yui_3_2_0_18_134919033193454&quot;&gt;
&amp;nbsp; &amp;nbsp; }&lt;/div&gt;
&lt;div id=&quot;yiv867872189yui_3_2_0_18_134919033193454&quot;&gt;
&lt;span class=&quot;yiv867872189Apple-tab-span&quot; id=&quot;yiv867872189yui_3_2_0_18_1349190331934102&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div id=&quot;yiv867872189yui_3_2_0_18_134919033193454&quot;&gt;
&lt;div id=&quot;yiv867872189yui_3_2_0_18_134919033193454&quot;&gt;
&lt;span id=&quot;yiv867872189yui_3_2_0_18_1349190331934147&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div id=&quot;yiv867872189yui_3_2_0_18_134919033193454&quot;&gt;
&lt;span id=&quot;yiv867872189yui_3_2_0_18_1349190331934142&quot; style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; dependencies {&lt;/span&gt;&lt;/div&gt;
&lt;div id=&quot;yiv867872189yui_3_2_0_18_134919033193454&quot;&gt;
&lt;span id=&quot;yiv867872189yui_3_2_0_18_1349190331934122&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;yiv867872189Apple-tab-span&quot; id=&quot;yiv867872189yui_3_2_0_18_1349190331934137&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;nbsp; ....&lt;/span&gt;&lt;/div&gt;
&lt;div id=&quot;yiv867872189yui_3_2_0_18_134919033193454&quot;&gt;
&lt;span id=&quot;yui_3_2_0_22_1349406513805259&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;yiv867872189Apple-tab-span&quot; id=&quot;yiv867872189yui_3_2_0_18_1349190331934175&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;background-color: yellow;&quot;&gt;compile &#39;ch.qos.logback:logback-classic:1.0.6&#39;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div id=&quot;yiv867872189yui_3_2_0_18_134919033193454&quot;&gt;
&lt;span style=&quot;font-size: x-small; white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;/div&gt;
&lt;div id=&quot;yiv867872189yui_3_2_0_18_134919033193454&quot;&gt;
&lt;span id=&quot;yiv867872189yui_3_2_0_18_1349190331934117&quot; style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;yui_3_2_0_22_134940651380594&quot; id=&quot;yiv867872189yui_3_2_0_18_134919033193454&quot;&gt;
&lt;span id=&quot;yiv867872189yui_3_2_0_18_1349190331934209&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;yui_3_2_0_22_134940651380596&quot; id=&quot;yiv867872189yui_3_2_0_18_134919033193460&quot; style=&quot;background-color: white; font-family: arial, helvetica, sans-serif; font-size: 13px;&quot;&gt;
//last line in the file to specify config file location&lt;/div&gt;
&lt;div class=&quot;yui_3_2_0_22_134940651380598&quot; id=&quot;yiv867872189yui_3_2_0_18_134919033193460&quot; style=&quot;font-family: arial, helvetica, sans-serif; font-size: 13px;&quot;&gt;
&lt;span style=&quot;background-color: lime;&quot;&gt;this.classLoader.rootLoader.addURL(new File(&quot;${basedir}/grails-app/conf&quot;).toURI().toURL())&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;yui_3_2_0_22_1349406513805100&quot; id=&quot;yiv867872189yui_3_2_0_18_134919033193460&quot; style=&quot;background-color: white; font-family: arial, helvetica, sans-serif; font-size: 13px;&quot;&gt;
&lt;br id=&quot;yiv867872189yui_3_2_0_18_1349190331934220&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;yui_3_2_0_22_1349406513805102&quot; id=&quot;yiv867872189yui_3_2_0_18_134919033193460&quot; style=&quot;font-family: arial, helvetica, sans-serif; font-size: 13px;&quot;&gt;
Once the changes above are made, we can use annotation to log information.&lt;/div&gt;
&lt;div class=&quot;yui_3_2_0_22_1349406513805102&quot; id=&quot;yiv867872189yui_3_2_0_18_134919033193460&quot; style=&quot;font-family: arial, helvetica, sans-serif; font-size: 13px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;yui_3_2_0_22_1349406513805104&quot; id=&quot;yiv867872189yui_3_2_0_18_134919033193460&quot; style=&quot;font-family: arial, helvetica, sans-serif; font-size: 13px;&quot;&gt;
Using logging in your controller or service is as simple as using an annotation and the right log method.&lt;/div&gt;
&lt;div class=&quot;yui_3_2_0_22_1349406513805106&quot; id=&quot;yiv867872189yui_3_2_0_18_134919033193460&quot; style=&quot;font-family: arial, helvetica, sans-serif; font-size: 13px;&quot;&gt;
You need to use the annotation&amp;nbsp;@Slf4j.&lt;/div&gt;
&lt;div class=&quot;yui_3_2_0_22_1349406513805108&quot; id=&quot;yiv867872189yui_3_2_0_18_134919033193460&quot; style=&quot;font-family: arial, helvetica, sans-serif; font-size: 13px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;yui_3_2_0_22_1349406513805110&quot; id=&quot;yiv867872189yui_3_2_0_18_134919033193460&quot; style=&quot;font-family: arial, helvetica, sans-serif; font-size: 13px;&quot;&gt;
&lt;span id=&quot;yiv867872189yui_3_2_0_18_1349190331934334&quot;&gt;&lt;br id=&quot;yiv867872189yui_3_2_0_18_1349190331934337&quot; /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;yui_3_2_0_22_1349406513805110&quot; id=&quot;yiv867872189yui_3_2_0_18_134919033193460&quot; style=&quot;font-family: arial, helvetica, sans-serif; font-size: 13px;&quot;&gt;
Here is an example:&lt;/div&gt;
&lt;div class=&quot;yui_3_2_0_22_1349406513805110&quot; id=&quot;yiv867872189yui_3_2_0_18_134919033193460&quot; style=&quot;font-family: arial, helvetica, sans-serif; font-size: 13px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;yui_3_2_0_22_1349406513805112&quot; id=&quot;yiv867872189yui_3_2_0_18_134919033193460&quot; style=&quot;font-family: arial, helvetica, sans-serif; font-size: 13px;&quot;&gt;
&lt;span id=&quot;yiv867872189yui_3_2_0_18_1349190331934329&quot;&gt;import groovy.util.logging.Slf4j&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;yui_3_2_0_22_1349406513805114&quot; id=&quot;yiv867872189yui_3_2_0_18_134919033193460&quot; style=&quot;font-family: arial, helvetica, sans-serif; font-size: 13px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div id=&quot;yiv867872189yui_3_2_0_18_134919033193460&quot; style=&quot;font-family: arial, helvetica, sans-serif; font-size: 13px;&quot;&gt;
&lt;div id=&quot;yiv867872189yui_3_2_0_18_134919033193460&quot;&gt;
&lt;span id=&quot;yiv867872189yui_3_2_0_18_1349190331934305&quot;&gt;@Slf4j&lt;/span&gt;&lt;/div&gt;
&lt;div id=&quot;yiv867872189yui_3_2_0_18_134919033193460&quot;&gt;
&lt;span id=&quot;yiv867872189yui_3_2_0_18_1349190331934280&quot;&gt;class XXXController {&lt;/span&gt;&lt;/div&gt;
&lt;div id=&quot;yiv867872189yui_3_2_0_18_134919033193460&quot;&gt;
&lt;span id=&quot;yiv867872189yui_3_2_0_18_1349190331934273&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div id=&quot;yiv867872189yui_3_2_0_18_134919033193460&quot;&gt;
&lt;span id=&quot;yiv867872189yui_3_2_0_18_1349190331934268&quot;&gt;&lt;span class=&quot;yiv867872189Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;def yyyy() {&lt;/span&gt;&lt;/div&gt;
&lt;div id=&quot;yiv867872189yui_3_2_0_18_134919033193460&quot;&gt;
&lt;span id=&quot;yiv867872189yui_3_2_0_18_1349190331934288&quot;&gt;&lt;span class=&quot;yiv867872189Apple-tab-span&quot; id=&quot;yiv867872189yui_3_2_0_18_1349190331934259&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;log.debug &quot;yyyy called.&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;yui_3_2_0_22_1349406513805128&quot; id=&quot;yiv867872189yui_3_2_0_18_134919033193460&quot;&gt;
&lt;span id=&quot;yiv867872189yui_3_2_0_18_1349190331934291&quot;&gt;&lt;span class=&quot;yiv867872189Apple-tab-span&quot; id=&quot;yiv867872189yui_3_2_0_18_1349190331934298&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;...&lt;/span&gt;&lt;/div&gt;
&lt;div id=&quot;yiv867872189yui_3_2_0_18_134919033193460&quot;&gt;
&lt;span id=&quot;yiv867872189yui_3_2_0_18_1349190331934285&quot;&gt;&lt;span class=&quot;yiv867872189Apple-tab-span&quot; id=&quot;yiv867872189yui_3_2_0_18_1349190331934250&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;render view:&quot;myview&quot;;&lt;/span&gt;&lt;/div&gt;
&lt;div id=&quot;yiv867872189yui_3_2_0_18_134919033193460&quot;&gt;
&lt;span id=&quot;yiv867872189yui_3_2_0_18_1349190331934243&quot;&gt;&lt;span class=&quot;yiv867872189Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div id=&quot;yiv867872189yui_3_2_0_18_134919033193460&quot;&gt;
We were able to use the @Slf4j in services controller and even spock integration tests.&lt;/div&gt;
&lt;div id=&quot;yiv867872189yui_3_2_0_18_134919033193460&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div id=&quot;yiv867872189yui_3_2_0_18_134919033193460&quot;&gt;
Hope this helps you in configuring &amp;nbsp;Slf4j and logback in your grails application.&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://springandgrailsmusings.blogspot.com/feeds/6260036663158804419/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://springandgrailsmusings.blogspot.com/2012/10/using-logback-and-slf4j-in-grails.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6203993754213672453/posts/default/6260036663158804419'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6203993754213672453/posts/default/6260036663158804419'/><link rel='alternate' type='text/html' href='http://springandgrailsmusings.blogspot.com/2012/10/using-logback-and-slf4j-in-grails.html' title='Using logback and slf4j in grails application'/><author><name>trbala(Bala Thiruppanambakkam)</name><uri>http://www.blogger.com/profile/05837199969474593390</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6203993754213672453.post-5141179297429838237</id><published>2011-02-21T21:47:00.000-08:00</published><updated>2011-02-21T21:47:26.352-08:00</updated><title type='text'>Registering new bean classes in grails application programmatically</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;As part of amazing goodies of grails is the ability to extend your applications - &amp;nbsp;registering new classes programmaticaly is a breeze&lt;/span&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;As the grails guru Burt points out here it just requires minimal effort;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;a href=&quot;http://grails.1312388.n4.nabble.com/Apache-Commons-IO-2-0-1-td3307531.html#a3307950&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;http://grails.1312388.n4.nabble.com/Apache-Commons-IO-2-0-1-td3307531.html#a3307950&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;//first create a bean definition&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;def myBeanDef = new GenericBeanDefinition()&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;//set bean class&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; color: #333333;&quot;&gt;&lt;code style=&quot;color: #2c7b14; text-decoration: none;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse; color: black; text-decoration: none;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;myBeanDef.setBeanClass(YourBeanClass)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;//set scope&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse;&quot;&gt;myBeanDef.setScope&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #2c7b14;&quot;&gt;(BeanDefinition.SCOPE_SINGLETON)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;//set others&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;//register&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;grailsApplication.mainContext.registerBeanDefinition &quot;someName&quot;, myBeanDef&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Programming in grails is really a pleasure.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://springandgrailsmusings.blogspot.com/feeds/5141179297429838237/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://springandgrailsmusings.blogspot.com/2011/02/registering-new-bean-classes-in-grails.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6203993754213672453/posts/default/5141179297429838237'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6203993754213672453/posts/default/5141179297429838237'/><link rel='alternate' type='text/html' href='http://springandgrailsmusings.blogspot.com/2011/02/registering-new-bean-classes-in-grails.html' title='Registering new bean classes in grails application programmatically'/><author><name>trbala(Bala Thiruppanambakkam)</name><uri>http://www.blogger.com/profile/05837199969474593390</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6203993754213672453.post-6033961709347626224</id><published>2011-02-12T23:10:00.000-08:00</published><updated>2011-02-12T23:10:07.806-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SES amazon grails aws plugin"/><title type='text'>Using Amazon SES from grails application</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;Amazon recently announced their Simple Email Service.&lt;br /&gt;
I wanted to integrate this with the application I am building in grails and was pleasantly surprised at how seamless &amp;nbsp;the integration was and wanted to share my thoughts.&lt;br /&gt;
&lt;br /&gt;
Plugin for aws provides excellent support and has very good documentation. There was only one thing that I found out different from what was speciifed in the docs.(see below)&lt;br /&gt;
&lt;br /&gt;
Steps for getting ses support are&lt;br /&gt;
&lt;br /&gt;
1. Sign up for SES&lt;br /&gt;
&lt;br /&gt;
2. Install plugin aws&lt;br /&gt;
grails install-plugin aws&lt;br /&gt;
&lt;br /&gt;
3. Set up credentials as described in aws plugin docs.&lt;br /&gt;
My config looks like this&lt;br /&gt;
&lt;br /&gt;
grails {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;plugin {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; aws {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; &amp;nbsp;credentials {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt; accessKey = &quot;...&quot;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt; secretKey = &quot;...&quot;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; &amp;nbsp;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; &amp;nbsp;ses {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt; &amp;nbsp;enabled = true&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt; &amp;nbsp;from = &quot;xxx@xxx.com&quot;&lt;br /&gt;
&amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; &amp;nbsp;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; }&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
&amp;nbsp;}&lt;br /&gt;
&lt;br /&gt;
One thing that was different from docs was that I had to set enabled=true to get emails to work.(Doc said it was defaulting to true but it did not work for me!!)&lt;br /&gt;
&lt;br /&gt;
4. Ensure your email is validated by SES&lt;br /&gt;
grails aws-ses-verify-email&lt;br /&gt;
You need this last step only if you dont have production access for SES(NOTE By default if you sign up you get only sanbox access. You have request production access separately)&lt;br /&gt;
Also note that both the sender and recipient emails have to be validated with SES if you dont have production access for your application with SES.&lt;br /&gt;
&lt;br /&gt;
Emails are a breeze from this point. For e.g. my controller save() has this code as described by aws plugin doc:&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;def msg= sesMail {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;to &quot;xxx@xxx.com&quot;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;subject &quot;What a message&quot;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;body &quot;sendPlainTextMail (${new Date().format(&#39;dd/MM/yyyy HH:mm&#39;)})&quot;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;}&lt;br /&gt;
flash.message = &amp;nbsp;&quot;E-mail sent: ${msg}&quot;&lt;br /&gt;
&lt;br /&gt;
Hope this helps you get started with SES.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://springandgrailsmusings.blogspot.com/feeds/6033961709347626224/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://springandgrailsmusings.blogspot.com/2011/02/using-amazon-ses-from-grails.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6203993754213672453/posts/default/6033961709347626224'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6203993754213672453/posts/default/6033961709347626224'/><link rel='alternate' type='text/html' href='http://springandgrailsmusings.blogspot.com/2011/02/using-amazon-ses-from-grails.html' title='Using Amazon SES from grails application'/><author><name>trbala(Bala Thiruppanambakkam)</name><uri>http://www.blogger.com/profile/05837199969474593390</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6203993754213672453.post-1962377027990083946</id><published>2011-01-27T18:35:00.000-08:00</published><updated>2011-01-29T13:24:49.241-08:00</updated><title type='text'>Getting user credentials in a grails application using Spring Security</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;
Getting user credentials in a grails application using Spring Security is pretty easy&lt;br /&gt;
&lt;br /&gt;
If you followed the instructions given for spring security plugin then&amp;nbsp;LoginController takes care of storing the user credentaisl for you.&lt;br /&gt;
To retrieve the stored credentials you need to do these&lt;br /&gt;
1. Import&amp;nbsp;SecurityContextHolder&lt;br /&gt;
import org.springframework.security.core.context.SecurityContextHolder as SCH&lt;br /&gt;
&lt;br /&gt;
2.Get the principal&lt;br /&gt;
SCH.context?.authentication?.principal&lt;br /&gt;
&lt;br /&gt;
3. once you get hold of the principal object you can retrieve and use any creds.&lt;br /&gt;
&lt;br /&gt;
SCH.context?.authentication?.principal?.username&lt;br /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;Update: Thanks for Burt for pointing out how I can make this easier.&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;I can use SpringSecurity service injected &amp;nbsp;by declaring&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;def springSecurityService&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;Then this can be used&amp;nbsp;like&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; springSecurityService.principal&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;to get the principal.&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://springandgrailsmusings.blogspot.com/feeds/1962377027990083946/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://springandgrailsmusings.blogspot.com/2011/01/getting-user-credentials-in-grails.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6203993754213672453/posts/default/1962377027990083946'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6203993754213672453/posts/default/1962377027990083946'/><link rel='alternate' type='text/html' href='http://springandgrailsmusings.blogspot.com/2011/01/getting-user-credentials-in-grails.html' title='Getting user credentials in a grails application using Spring Security'/><author><name>trbala(Bala Thiruppanambakkam)</name><uri>http://www.blogger.com/profile/05837199969474593390</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6203993754213672453.post-4836489133489387705</id><published>2011-01-11T22:48:00.000-08:00</published><updated>2011-01-11T22:48:34.241-08:00</updated><title type='text'>Removing unwanted jar dependencies in the grails built war file</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: monospace; font-size: 15px; line-height: 17px;&quot;&gt;Peter Ledbrook shared a neat way of removing runtime dependency in the grails built war file. If for e.g. we wanted to exclude&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: monospace; font-size: 15px; line-height: 17px;&quot;&gt;hsqldb&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: monospace; font-size: 15px; line-height: 17px;&quot;&gt;&lt;br style=&quot;line-height: 1.2em; outline-color: initial; outline-style: none; outline-width: initial;&quot; /&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: monospace; font-size: 15px; line-height: 17px;&quot;&gt;&amp;nbsp; &amp;nbsp; grails.project.dependency.resolution = {&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: monospace; font-size: 15px; line-height: 17px;&quot;&gt;&lt;br style=&quot;line-height: 1.2em; outline-color: initial; outline-style: none; outline-width: initial;&quot; /&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: monospace; font-size: 15px; line-height: 17px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; inherits(&quot;global&quot;) {&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: monospace; font-size: 15px; line-height: 17px;&quot;&gt;&lt;br style=&quot;line-height: 1.2em; outline-color: initial; outline-style: none; outline-width: initial;&quot; /&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: monospace; font-size: 15px; line-height: 17px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (Environment.current == Environment.PRODUCTION) {&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: monospace; font-size: 15px; line-height: 17px;&quot;&gt;&lt;br style=&quot;line-height: 1.2em; outline-color: initial; outline-style: none; outline-width: initial;&quot; /&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: monospace; font-size: 15px; line-height: 17px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; exclude &quot;hsqldb&quot;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: monospace; font-size: 15px; line-height: 17px;&quot;&gt;&lt;br style=&quot;line-height: 1.2em; outline-color: initial; outline-style: none; outline-width: initial;&quot; /&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: monospace; font-size: 15px; line-height: 17px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: monospace; font-size: 15px; line-height: 17px;&quot;&gt;&lt;br style=&quot;line-height: 1.2em; outline-color: initial; outline-style: none; outline-width: initial;&quot; /&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: monospace; font-size: 15px; line-height: 17px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: monospace; font-size: 15px; line-height: 17px;&quot;&gt;&lt;br style=&quot;line-height: 1.2em; outline-color: initial; outline-style: none; outline-width: initial;&quot; /&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: monospace; font-size: 15px; line-height: 17px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ...&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: monospace; font-size: 15px; line-height: 17px;&quot;&gt;&lt;br style=&quot;line-height: 1.2em; outline-color: initial; outline-style: none; outline-width: initial;&quot; /&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: monospace; font-size: 15px; line-height: 17px;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://springandgrailsmusings.blogspot.com/feeds/4836489133489387705/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://springandgrailsmusings.blogspot.com/2011/01/removing-unwanted-jar-dependencies-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6203993754213672453/posts/default/4836489133489387705'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6203993754213672453/posts/default/4836489133489387705'/><link rel='alternate' type='text/html' href='http://springandgrailsmusings.blogspot.com/2011/01/removing-unwanted-jar-dependencies-in.html' title='Removing unwanted jar dependencies in the grails built war file'/><author><name>trbala(Bala Thiruppanambakkam)</name><uri>http://www.blogger.com/profile/05837199969474593390</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6203993754213672453.post-3822528868080344281</id><published>2010-12-24T01:07:00.000-08:00</published><updated>2010-12-24T01:07:07.069-08:00</updated><title type='text'>Grails template driven emailing with mail plugin</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #424037; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 21px;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;In this post I will walk through how to configure email using mail plugin.&lt;/div&gt;&lt;div style=&quot;margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;1. Install mail plugin in your project.&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;grails install-plugin mail&lt;/div&gt;&lt;div style=&quot;margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;2.&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;Add activation and mail jars to lib directory.&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;I use these jars&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;activation:1.1.1&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;mail-1.4.3&lt;/div&gt;&lt;div style=&quot;margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;3.&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;To resources.groovy add mailSender definition and configure it&lt;/div&gt;&lt;div style=&quot;margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; mailSender(org.springframework.mail.javamail.JavaMailSenderImpl) {&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; host = &#39;&lt;a href=&quot;http://smtp.gmail.com/&quot; style=&quot;color: #bc7134; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;&lt;span class=&quot;yshortcuts&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;smtp.gmail.com&lt;/span&gt;&lt;/a&gt;&#39;&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; port = 465&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; username = &#39;&lt;span class=&quot;yshortcuts&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;a href=&quot;mailto:xxx@gmail.com&quot; style=&quot;color: #bc7134; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: none;&quot;&gt;xxx@gmail.com&lt;/a&gt;&lt;/span&gt;&#39;&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; password = &#39;xxx&#39;&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; javaMailProperties = [&#39;mail.smtp.auth&#39;: &#39;true&#39;,&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &#39;mail.smtp.socketFactory.port&#39;: &#39;465&#39;,&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &#39;mail.smtp.socketFactory.class&#39;: &#39;&lt;a href=&quot;http://javax.net/&quot; style=&quot;color: #bc7134; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;&lt;span class=&quot;yshortcuts&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;javax.net&lt;/span&gt;&lt;/a&gt;.ssl.SSLSocketFactory&#39;,&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &#39;mail.smtp.socketFactory.fallback&#39;: &#39;false&#39;]&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;4. Add a email template(if needed)&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;Create a directory grails-app\views\emailtemplates&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;Add a email.gsp with code you want -sample below&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;lt;%@ page contentType=&quot;text/html&quot; %&amp;gt;&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;lt;html&amp;gt;&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;lt;head&amp;gt;&amp;lt;title&amp;gt;${mytitle}&amp;lt;/title&amp;gt;&amp;lt;/head&amp;gt;&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;lt;body&amp;gt;&amp;lt;h1&amp;gt;${mymail}&amp;lt;/h1&amp;gt;&amp;lt;/body&amp;gt;&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;lt;/html&amp;gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;ContentType of the gsp should be changed based on your need.&lt;/div&gt;&lt;div style=&quot;margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;5. In your controller add the emailing code&lt;/div&gt;&lt;div style=&quot;margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mailService.sendMail{&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; to&amp;nbsp;&amp;nbsp;&amp;nbsp; &quot;&lt;span class=&quot;yshortcuts&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;a href=&quot;mailto:xxx@yahoo.com&quot; style=&quot;color: #bc7134; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: none;&quot;&gt;xxx@yahoo.com&lt;/a&gt;&lt;/span&gt;&quot;&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from&amp;nbsp; &quot;&lt;a href=&quot;mailto:xxx@gmail.com&quot; style=&quot;color: #bc7134; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: none;&quot;&gt;xxx@gmail.com&lt;/a&gt;&quot;&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; subject&amp;nbsp; &quot;Email test&quot;&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; body&amp;nbsp; (&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; view: &quot;/emailtemplates/email&quot;,&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; model: [mytitle: &quot;My title&quot;, mymail: &quot;Test Email&quot;]&lt;/div&gt;&lt;div style=&quot;margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If you dont need a template to render from just supply the body of the email.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://springandgrailsmusings.blogspot.com/feeds/3822528868080344281/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://springandgrailsmusings.blogspot.com/2010/12/grails-template-driven-emailing-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6203993754213672453/posts/default/3822528868080344281'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6203993754213672453/posts/default/3822528868080344281'/><link rel='alternate' type='text/html' href='http://springandgrailsmusings.blogspot.com/2010/12/grails-template-driven-emailing-with.html' title='Grails template driven emailing with mail plugin'/><author><name>trbala(Bala Thiruppanambakkam)</name><uri>http://www.blogger.com/profile/05837199969474593390</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6203993754213672453.post-8935284339274080703</id><published>2010-12-21T18:33:00.000-08:00</published><updated>2010-12-21T18:33:10.953-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="grails JSON multipart upload"/><title type='text'>Grails and JSON:Consuming JSON data via multi-part form upload</title><content type='html'>&lt;div style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse; font-family: arial; font-size: 10pt; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;JSON is a concise format that is extremely popular for&amp;nbsp;&lt;span class=&quot;yshortcuts&quot; id=&quot;lw_1292985065_1&quot; style=&quot;line-height: 1.2em; outline-color: initial; outline-style: none; outline-width: initial;&quot;&gt;data exchange&lt;/span&gt;.&lt;/div&gt;&lt;div style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse; font-family: arial; font-size: 10pt; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Most webservices these days consume JSON as input for processing instead of XML as it is lightweight(depenedent on domain)&lt;/div&gt;&lt;div style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse; font-family: arial; font-size: 10pt; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;br style=&quot;line-height: 1.2em; outline-color: initial; outline-style: none; outline-width: initial;&quot; /&gt;&lt;/div&gt;&lt;div style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse; font-family: arial; font-size: 10pt; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Here is an example of consuming a json file uploaded via a web form in you web application using grails.&lt;/div&gt;&lt;div style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse; font-family: arial; font-size: 10pt; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;br style=&quot;line-height: 1.2em; outline-color: initial; outline-style: none; outline-width: initial;&quot; /&gt;&lt;/div&gt;&lt;div style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse; font-family: arial; font-size: 10pt; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Grails as usual provides fantastic support for JSON parsing.&lt;/div&gt;&lt;div style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse; font-family: arial; font-size: 10pt; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span class=&quot;yshortcuts&quot; id=&quot;lw_1292985065_2&quot; style=&quot;line-height: 1.2em; outline-color: initial; outline-style: none; outline-width: initial;&quot;&gt;Parsing&lt;/span&gt;&amp;nbsp;a JSON input and creating domain objects out this is very easy with grails.&lt;/div&gt;&lt;div style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse; font-family: arial; font-size: 10pt; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;br style=&quot;line-height: 1.2em; outline-color: initial; outline-style: none; outline-width: initial;&quot; /&gt;&lt;/div&gt;&lt;div style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse; font-family: arial; font-size: 10pt; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;I have a domain object like this&lt;/div&gt;&lt;div style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse; font-family: arial; font-size: 10pt; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;div style=&quot;line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;class Message {&lt;/div&gt;&lt;div style=&quot;line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span class=&quot;yiv1439242203Apple-tab-span&quot; style=&quot;line-height: 1.2em; outline-color: initial; outline-style: none; outline-width: initial; white-space: pre;&quot;&gt; &lt;/span&gt;String name&lt;/div&gt;&lt;div style=&quot;line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span class=&quot;yiv1439242203Apple-tab-span&quot; style=&quot;line-height: 1.2em; outline-color: initial; outline-style: none; outline-width: initial; white-space: pre;&quot;&gt; &lt;/span&gt;String content&lt;/div&gt;&lt;div style=&quot;line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span class=&quot;yiv1439242203Apple-tab-span&quot; style=&quot;line-height: 1.2em; outline-color: initial; outline-style: none; outline-width: initial; white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;static constraints = {&lt;/div&gt;&lt;div style=&quot;line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;name(nullable:false)&lt;/div&gt;&lt;div style=&quot;line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;content(nullable:false)&lt;/div&gt;&lt;div style=&quot;line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;}&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse; font-family: arial; font-size: 10pt; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;br style=&quot;line-height: 1.2em; outline-color: initial; outline-style: none; outline-width: initial;&quot; /&gt;&lt;/div&gt;&lt;div style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse; font-family: arial; font-size: 10pt; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Here is a sample JSON input file that can be used for creating multiple domain objects&lt;/div&gt;&lt;div style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse; font-family: arial; font-size: 10pt; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;br style=&quot;line-height: 1.2em; outline-color: initial; outline-style: none; outline-width: initial;&quot; /&gt;&lt;/div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse; font-family: arial, helvetica, clean, sans-serif; font-size: 14px; line-height: 16px;&quot;&gt;&lt;span class=&quot;yiv1439242203Apple-style-span&quot; style=&quot;font-family: arial; font-size: x-small; line-height: 1.2em; outline-color: initial; outline-style: none; outline-width: initial;&quot;&gt;File:Messages.json&lt;/span&gt;&lt;/span&gt;&lt;div style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse; font-family: arial, helvetica, clean, sans-serif; font-size: 14px; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;div style=&quot;font-family: arial; font-size: 10pt; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span class=&quot;yiv1439242203Apple-style-span&quot; style=&quot;font-size: 15.6px; line-height: 1.2em; outline-color: initial; outline-style: none; outline-width: initial;&quot;&gt;[&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: arial; font-size: 10pt; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span class=&quot;yiv1439242203Apple-tab-span&quot; style=&quot;line-height: 1.2em; outline-color: initial; outline-style: none; outline-width: initial; white-space: pre;&quot;&gt; &lt;/span&gt;{&quot;name&quot;:&quot;ann&quot;,&quot;content&quot;:&quot;What a Wonderful World&quot;},&lt;/div&gt;&lt;div style=&quot;font-family: arial; font-size: 10pt; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span class=&quot;yiv1439242203Apple-tab-span&quot; style=&quot;line-height: 1.2em; outline-color: initial; outline-style: none; outline-width: initial; white-space: pre;&quot;&gt; &lt;/span&gt;{&quot;name&quot;:&quot;nandhu&quot;,&quot;content&quot;:&quot;Wonderful World&quot;},&lt;/div&gt;&lt;div style=&quot;font-family: arial; font-size: 10pt; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;]&lt;/div&gt;&lt;div style=&quot;font-family: arial; font-size: 10pt; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;br style=&quot;line-height: 1.2em; outline-color: initial; outline-style: none; outline-width: initial;&quot; /&gt;&lt;/div&gt;&lt;div style=&quot;font-family: arial; font-size: 10pt; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Note that JSON representation is very simple.&lt;/div&gt;&lt;div style=&quot;font-family: arial; font-size: 10pt; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Key,Value pairs separated by &quot;:&quot; for each property and enclosed in {} constitute one object.&lt;/div&gt;&lt;div style=&quot;font-family: arial; font-size: 10pt; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Objects can be separated by comma and enclosed with [] to constitute an array of like objects.&lt;/div&gt;&lt;div style=&quot;font-family: arial; font-size: 10pt; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;br style=&quot;line-height: 1.2em; outline-color: initial; outline-style: none; outline-width: initial;&quot; /&gt;&lt;/div&gt;&lt;div style=&quot;font-family: arial; font-size: 10pt; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;In order to upload the JSON file we would need a multipart form upload gsp as shown below&lt;/div&gt;&lt;div style=&quot;font-family: arial; font-size: 10pt; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;br style=&quot;line-height: 1.2em; outline-color: initial; outline-style: none; outline-width: initial;&quot; /&gt;&lt;/div&gt;&lt;div style=&quot;font-family: arial; font-size: 10pt; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;//form multipart upload code&lt;/div&gt;&lt;div style=&quot;font-family: arial; font-size: 10pt; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;div style=&quot;line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;div&amp;gt;&lt;/div&gt;&lt;div style=&quot;line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;g:form method=&quot;post&quot; action=&quot;postRest&quot; enctype=&quot;multipart/form-data&quot;&amp;gt;&lt;/div&gt;&lt;div style=&quot;line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span class=&quot;yiv1439242203Apple-tab-span&quot; style=&quot;line-height: 1.2em; outline-color: initial; outline-style: none; outline-width: initial; white-space: pre;&quot;&gt;  &lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;input type=&quot;file&quot; name=&quot;file&quot;/&amp;gt;&lt;/div&gt;&lt;div style=&quot;line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span class=&quot;yiv1439242203Apple-tab-span&quot; style=&quot;line-height: 1.2em; outline-color: initial; outline-style: none; outline-width: initial; white-space: pre;&quot;&gt;  &lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;input type=&quot;submit&quot;/&amp;gt;&lt;/div&gt;&lt;div style=&quot;line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span class=&quot;yiv1439242203Apple-tab-span&quot; style=&quot;line-height: 1.2em; outline-color: initial; outline-style: none; outline-width: initial; white-space: pre;&quot;&gt;  &lt;/span&gt;&amp;lt;/g:form&amp;gt;&lt;/div&gt;&lt;div style=&quot;line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/div&amp;gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;font-family: arial; font-size: 10pt; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;br style=&quot;line-height: 1.2em; outline-color: initial; outline-style: none; outline-width: initial;&quot; /&gt;&lt;/div&gt;&lt;div style=&quot;font-family: arial; font-size: 10pt; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;This form does a post to action called &quot;postRest&quot; on the same controller.&lt;/div&gt;&lt;div style=&quot;font-family: arial; font-size: 10pt; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;A different controller can be used by using controller=&quot;name&quot; property in addition&lt;/div&gt;&lt;div style=&quot;font-family: arial; font-size: 10pt; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;br style=&quot;line-height: 1.2em; outline-color: initial; outline-style: none; outline-width: initial;&quot; /&gt;&lt;/div&gt;&lt;div style=&quot;font-family: arial; font-size: 10pt; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Now finally you need to add the controller action.&lt;/div&gt;&lt;div style=&quot;font-family: arial; font-size: 10pt; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;There you have to get the JSON representation first.&lt;/div&gt;&lt;div style=&quot;font-family: arial; font-size: 10pt; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Then you create a domain object and fill data into it from JSON representation.&lt;/div&gt;&lt;div style=&quot;font-family: arial; font-size: 10pt; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Finally you save this object.&lt;/div&gt;&lt;div style=&quot;font-family: arial; font-size: 10pt; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Make sure you check the newly saved object to ensure there arent any errors.&lt;/div&gt;&lt;div style=&quot;font-family: arial; font-size: 10pt; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;br style=&quot;line-height: 1.2em; outline-color: initial; outline-style: none; outline-width: initial;&quot; /&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;div style=&quot;line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span class=&quot;yiv1439242203Apple-style-span&quot; style=&quot;font-family: arial; font-size: x-small; line-height: 1.2em; outline-color: initial; outline-style: none; outline-width: initial;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;def postRest = {&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span class=&quot;yiv1439242203Apple-style-span&quot; style=&quot;font-family: arial; font-size: x-small; line-height: 1.2em; outline-color: initial; outline-style: none; outline-width: initial;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;span class=&quot;yiv1439242203Apple-tab-span&quot; style=&quot;line-height: 1.2em; outline-color: initial; outline-style: none; outline-width: initial; white-space: pre;&quot;&gt; &lt;/span&gt;println request.getFile(&quot;file&quot;).inputStream.text&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span class=&quot;yiv1439242203Apple-style-span&quot; style=&quot;font-family: arial; font-size: x-small; line-height: 1.2em; outline-color: initial; outline-style: none; outline-width: initial;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;span class=&quot;yiv1439242203Apple-tab-span&quot; style=&quot;line-height: 1.2em; outline-color: initial; outline-style: none; outline-width: initial; white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span class=&quot;yiv1439242203Apple-style-span&quot; style=&quot;font-family: arial; font-size: x-small; line-height: 1.2em; outline-color: initial; outline-style: none; outline-width: initial;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;span class=&quot;yiv1439242203Apple-tab-span&quot; style=&quot;line-height: 1.2em; outline-color: initial; outline-style: none; outline-width: initial; white-space: pre;&quot;&gt; &lt;/span&gt;def jsonArray = JSON.parse(request.getFile(&quot;file&quot;).getInputStream(),&quot;UTF-8&quot;)&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span class=&quot;yiv1439242203Apple-style-span&quot; style=&quot;font-family: arial; font-size: x-small; line-height: 1.2em; outline-color: initial; outline-style: none; outline-width: initial;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;span class=&quot;yiv1439242203Apple-tab-span&quot; style=&quot;line-height: 1.2em; outline-color: initial; outline-style: none; outline-width: initial; white-space: pre;&quot;&gt; &lt;/span&gt;println &quot;jsonArray=${jsonArray}&quot;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span class=&quot;yiv1439242203Apple-style-span&quot; style=&quot;font-family: arial; font-size: x-small; line-height: 1.2em; outline-color: initial; outline-style: none; outline-width: initial;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;span class=&quot;yiv1439242203Apple-tab-span&quot; style=&quot;line-height: 1.2em; outline-color: initial; outline-style: none; outline-width: initial; white-space: pre;&quot;&gt; &lt;/span&gt;jsonArray.each{&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span class=&quot;yiv1439242203Apple-style-span&quot; style=&quot;font-family: arial; font-size: x-small; line-height: 1.2em; outline-color: initial; outline-style: none; outline-width: initial;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;span class=&quot;yiv1439242203Apple-tab-span&quot; style=&quot;line-height: 1.2em; outline-color: initial; outline-style: none; outline-width: initial; white-space: pre;&quot;&gt;   &lt;/span&gt;println it&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span class=&quot;yiv1439242203Apple-style-span&quot; style=&quot;font-family: arial; font-size: x-small; line-height: 1.2em; outline-color: initial; outline-style: none; outline-width: initial;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;span class=&quot;yiv1439242203Apple-tab-span&quot; style=&quot;line-height: 1.2em; outline-color: initial; outline-style: none; outline-width: initial; white-space: pre;&quot;&gt;   &lt;/span&gt;Message m = new Message()&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span class=&quot;yiv1439242203Apple-style-span&quot; style=&quot;font-family: arial; font-size: x-small; line-height: 1.2em; outline-color: initial; outline-style: none; outline-width: initial;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;span class=&quot;yiv1439242203Apple-tab-span&quot; style=&quot;line-height: 1.2em; outline-color: initial; outline-style: none; outline-width: initial; white-space: pre;&quot;&gt;   &lt;/span&gt;bindData(m, it)&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span class=&quot;yiv1439242203Apple-style-span&quot; style=&quot;font-family: arial; font-size: x-small; line-height: 1.2em; outline-color: initial; outline-style: none; outline-width: initial;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;span class=&quot;yiv1439242203Apple-tab-span&quot; style=&quot;line-height: 1.2em; outline-color: initial; outline-style: none; outline-width: initial; white-space: pre;&quot;&gt;   &lt;/span&gt;m.save(flush:true)&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span class=&quot;yiv1439242203Apple-style-span&quot; style=&quot;font-family: arial; font-size: x-small; line-height: 1.2em; outline-color: initial; outline-style: none; outline-width: initial;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;span class=&quot;yiv1439242203Apple-tab-span&quot; style=&quot;line-height: 1.2em; outline-color: initial; outline-style: none; outline-width: initial; white-space: pre;&quot;&gt;   &lt;/span&gt;if(m.errors) {&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span class=&quot;yiv1439242203Apple-style-span&quot; style=&quot;font-family: arial; font-size: x-small; line-height: 1.2em; outline-color: initial; outline-style: none; outline-width: initial;&quot;&gt;&lt;span class=&quot;yiv1439242203Apple-tab-span&quot; style=&quot;line-height: 1.2em; outline-color: initial; outline-style: none; outline-width: initial; white-space: pre;&quot;&gt;     &lt;/span&gt;m.errors.each{println it} &amp;nbsp; &amp;nbsp;&lt;span class=&quot;yiv1439242203Apple-tab-span&quot; style=&quot;line-height: 1.2em; outline-color: initial; outline-style: none; outline-width: initial; white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span class=&quot;yiv1439242203Apple-style-span&quot; style=&quot;font-family: arial; font-size: x-small; line-height: 1.2em; outline-color: initial; outline-style: none; outline-width: initial;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;span class=&quot;yiv1439242203Apple-tab-span&quot; style=&quot;line-height: 1.2em; outline-color: initial; outline-style: none; outline-width: initial; white-space: pre;&quot;&gt;   &lt;/span&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span class=&quot;yiv1439242203Apple-style-span&quot; style=&quot;font-family: arial; font-size: x-small; line-height: 1.2em; outline-color: initial; outline-style: none; outline-width: initial;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;span class=&quot;yiv1439242203Apple-tab-span&quot; style=&quot;line-height: 1.2em; outline-color: initial; outline-style: none; outline-width: initial; white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span class=&quot;yiv1439242203Apple-style-span&quot; style=&quot;font-family: arial; font-size: x-small; line-height: 1.2em; outline-color: initial; outline-style: none; outline-width: initial;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span class=&quot;yiv1439242203Apple-style-span&quot; style=&quot;font-family: arial; font-size: x-small; line-height: 1.2em; outline-color: initial; outline-style: none; outline-width: initial;&quot;&gt;&lt;br style=&quot;line-height: 1.2em; outline-color: initial; outline-style: none; outline-width: initial;&quot; /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span class=&quot;yiv1439242203Apple-style-span&quot; style=&quot;font-family: arial; font-size: x-small; line-height: 1.2em; outline-color: initial; outline-style: none; outline-width: initial;&quot;&gt;In the next post I will blog on how to expose this as a webservice.&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://springandgrailsmusings.blogspot.com/feeds/8935284339274080703/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://springandgrailsmusings.blogspot.com/2010/12/grails-and-jsonconsuming-json-data-via.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6203993754213672453/posts/default/8935284339274080703'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6203993754213672453/posts/default/8935284339274080703'/><link rel='alternate' type='text/html' href='http://springandgrailsmusings.blogspot.com/2010/12/grails-and-jsonconsuming-json-data-via.html' title='Grails and JSON:Consuming JSON data via multi-part form upload'/><author><name>trbala(Bala Thiruppanambakkam)</name><uri>http://www.blogger.com/profile/05837199969474593390</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6203993754213672453.post-2035197569652704031</id><published>2010-12-20T20:58:00.000-08:00</published><updated>2010-12-20T20:58:02.288-08:00</updated><title type='text'>Grails testing support enhanced:full emulation of GORM</title><content type='html'>Grails testing support enhanced to provide a full emulation of GORM.&lt;br /&gt;
Peter LedBrook(author of Grails in Action) has written a post how to get this in your project.&lt;br /&gt;
Pretty easy config and powerful features added.&lt;br /&gt;
Grails Rocks!&lt;br /&gt;
&lt;br /&gt;
Config changes needed in short are&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse; font-family: verdana, geneva, helvetica, arial, sans-serif; font-size: 13px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse; font-family: verdana, geneva, helvetica, arial, sans-serif; font-size: 13px;&quot;&gt;1.Add to&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse; font-family: verdana, geneva, helvetica, arial, sans-serif; font-size: 13px;&quot;&gt;repositories:&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse; font-family: verdana, geneva, helvetica, arial, sans-serif; font-size: 13px;&quot;&gt;mavenRepo &quot;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse; font-family: verdana, geneva, helvetica, arial, sans-serif; font-size: 13px;&quot;&gt;&lt;a href=&quot;http://maven.springframework.org/milestone&quot; link=&quot;external&quot; rel=&quot;nofollow&quot; style=&quot;font-size: 1em;&quot; target=&quot;_top&quot;&gt;http://maven.springframework.org/milestone&lt;/a&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse; font-family: verdana, geneva, helvetica, arial, sans-serif; font-size: 13px;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse; font-family: verdana, geneva, helvetica, arial, sans-serif; font-size: 13px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse; font-family: verdana, geneva, helvetica, arial, sans-serif; font-size: 13px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse; font-family: verdana, geneva, helvetica, arial, sans-serif; font-size: 13px;&quot;&gt;mavenRepo &quot;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse; font-family: verdana, geneva, helvetica, arial, sans-serif; font-size: 13px;&quot;&gt;&lt;a href=&quot;http://snapshots.repository.codehaus.org/&quot; link=&quot;external&quot; rel=&quot;nofollow&quot; style=&quot;font-size: 1em;&quot; target=&quot;_top&quot;&gt;http://snapshots.repository.codehaus.org&lt;/a&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse; font-family: verdana, geneva, helvetica, arial, sans-serif; font-size: 13px;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse; font-family: verdana, geneva, helvetica, arial, sans-serif; font-size: 13px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse; font-family: verdana, geneva, helvetica, arial, sans-serif; font-size: 13px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse; font-family: verdana, geneva, helvetica, arial, sans-serif; font-size: 13px;&quot;&gt;2.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse; font-family: verdana, geneva, helvetica, arial, sans-serif; font-size: 13px;&quot;&gt;test( &quot;org.grails:grails-datastore-gorm-test:1.0.0.M1&quot;) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;excludes &quot;persistence-api&quot;, &quot;sl4j-simple&quot;, &quot;commons-logging&quot;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;im&quot; style=&quot;border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-top-color: rgb(204, 204, 204);&quot;&gt;}&lt;/div&gt;&lt;div class=&quot;im&quot; style=&quot;border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-top-color: rgb(204, 204, 204);&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;im&quot; style=&quot;border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-top-color: rgb(204, 204, 204);&quot;&gt;3. Add to test&lt;/div&gt;&lt;div class=&quot;im&quot; style=&quot;border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-top-color: rgb(204, 204, 204);&quot;&gt;&amp;nbsp;@Mixin(DatastoreUnitTestMixin)&amp;nbsp;and&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;im&quot; style=&quot;border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-top-color: rgb(204, 204, 204);&quot;&gt;add a call to disconnect() in your tearDown()&lt;/div&gt;&lt;div class=&quot;im&quot; style=&quot;border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-top-color: rgb(204, 204, 204);&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;im&quot; style=&quot;border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-top-color: rgb(204, 204, 204);&quot;&gt;&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://springandgrailsmusings.blogspot.com/feeds/2035197569652704031/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://springandgrailsmusings.blogspot.com/2010/12/grails-testing-support-enhancedfull.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6203993754213672453/posts/default/2035197569652704031'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6203993754213672453/posts/default/2035197569652704031'/><link rel='alternate' type='text/html' href='http://springandgrailsmusings.blogspot.com/2010/12/grails-testing-support-enhancedfull.html' title='Grails testing support enhanced:full emulation of GORM'/><author><name>trbala(Bala Thiruppanambakkam)</name><uri>http://www.blogger.com/profile/05837199969474593390</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6203993754213672453.post-2627420547459928505</id><published>2010-12-08T17:07:00.000-08:00</published><updated>2011-01-11T23:04:35.145-08:00</updated><title type='text'>Grails and multi tenancy  - Multi tenancy setup with grails</title><content type='html'>&lt;div id=&quot;articles&quot; style=&quot;float: left; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;article class=&quot;post clearfix&quot; id=&quot;post_35277679&quot; style=&quot;display: block; margin-bottom: 35px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; position: relative; width: 655px;&quot;&gt;&lt;header style=&quot;display: block; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 5px; text-align: right; width: 655px;&quot;&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: -webkit-auto;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;editbox&quot; style=&quot;color: #424037; font-family: Arial, Helvetica, sans-serif; font-size: 10px; height: 16px; left: 155px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; position: absolute; top: 0px; visibility: hidden;&quot;&gt;&lt;ul class=&quot;mini_commands posterous_edit_box&quot; data-posterous-edit-box=&quot;true&quot; data-posterous-post-id=&quot;35277679&quot; style=&quot;cursor: pointer; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;li style=&quot;cursor: pointer; display: inline; font-size: 10px; list-style-type: none; margin-bottom: 0px; margin-left: 0px; margin-right: 10px; margin-top: 5px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;a href=&quot;http://posterous.com/posts/edit/35277679&quot; style=&quot;color: #aaaaaa; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: none;&quot;&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li style=&quot;cursor: pointer; display: inline; font-size: 10px; list-style-type: none; margin-bottom: 0px; margin-left: 0px; margin-right: 10px; margin-top: 5px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;a data-posterous-confirm=&quot;Are you sure you want to delete this post?&quot; data-posterous-delete-link=&quot;true&quot; href=&quot;http://trbala.posterous.com/posts/destroy/35277679&quot; style=&quot;color: #aaaaaa; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: none;&quot;&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li style=&quot;cursor: pointer; display: inline; font-size: 10px; list-style-type: none; margin-bottom: 0px; margin-left: 0px; margin-right: 10px; margin-top: 5px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;a data-posterous-post-id=&quot;35277679&quot; data-posterous-tag-modal=&quot;true&quot; href=&quot;http://trbala.posterous.com/multi-tenancy-setup-with-grails#&quot; id=&quot;tag_link_id_35277679&quot; style=&quot;color: #aaaaaa; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: none;&quot;&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li style=&quot;cursor: pointer; display: inline; font-size: 10px; list-style-type: none; margin-bottom: 0px; margin-left: 0px; margin-right: 10px; margin-top: 5px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;a data-posterous-autopost-modal=&quot;true&quot; data-posterous-post-id=&quot;35277679&quot; href=&quot;http://trbala.posterous.com/multi-tenancy-setup-with-grails#&quot; id=&quot;crosspost_link_id_35277679&quot; style=&quot;color: #aaaaaa; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: none;&quot;&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;&lt;/header&gt;&lt;div class=&quot;body&quot; style=&quot;display: inline; float: right; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; width: 500px;&quot;&gt;&lt;div class=&quot;inner&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;div style=&quot;color: #424037; font-family: Arial, Helvetica, sans-serif; font-size: 1.2em; line-height: 1.8em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;color: #424037; font-family: Arial, Helvetica, sans-serif; font-size: 1.2em; line-height: 1.8em; margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;I was playing with multi tenancy setup with grails.&lt;/div&gt;&lt;div style=&quot;color: #424037; font-family: Arial, Helvetica, sans-serif; font-size: 1.2em; line-height: 1.8em; margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;While there were some examples I found most them were old and werent updated for recent grails versions.&lt;/div&gt;&lt;div style=&quot;color: #424037; font-family: Arial, Helvetica, sans-serif; font-size: 1.2em; line-height: 1.8em; margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Ran into a bunch of errors when I tried to use multitenancy plugin with spring security.&lt;/div&gt;&lt;div style=&quot;color: #424037; font-family: Arial, Helvetica, sans-serif; font-size: 1.2em; line-height: 1.8em; margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Had to try out a few things before i was able to correct all the errors and get this working.&lt;/div&gt;&lt;div style=&quot;color: #424037; font-family: Arial, Helvetica, sans-serif; font-size: 1.2em; line-height: 1.8em; margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;I try here to give a step by step guide to setting up multitenancy for grails based apps.&lt;/div&gt;&lt;div style=&quot;color: #424037; font-family: Arial, Helvetica, sans-serif; font-size: 1.2em; line-height: 1.8em; margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;color: #424037; font-family: Arial, Helvetica, sans-serif; font-size: 1.2em; line-height: 1.8em; margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Create a simple domain class&lt;/div&gt;&lt;div style=&quot;color: #424037; font-family: Arial, Helvetica, sans-serif; font-size: 1.2em; line-height: 1.8em; margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;grails create-domain-class com.helloworld.Message&lt;/div&gt;&lt;div style=&quot;color: #424037; font-family: Arial, Helvetica, sans-serif; font-size: 1.2em; line-height: 1.8em; margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;color: #424037; font-family: Arial, Helvetica, sans-serif; font-size: 1.2em; line-height: 1.8em; margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;install spring security plugin&lt;/div&gt;&lt;div style=&quot;color: #424037; font-family: Arial, Helvetica, sans-serif; font-size: 1.2em; line-height: 1.8em; margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;gt;grails install-plugin spring-security-core&lt;/div&gt;&lt;div style=&quot;color: #424037; font-family: Arial, Helvetica, sans-serif; font-size: 1.2em; line-height: 1.8em; margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;color: #424037; font-family: Arial, Helvetica, sans-serif; font-size: 1.2em; line-height: 1.8em; margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Create the user and roles&lt;/div&gt;&lt;div style=&quot;color: #424037; font-family: Arial, Helvetica, sans-serif; font-size: 1.2em; line-height: 1.8em; margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;grails s2-quickstart org.racetrack User Role&lt;/div&gt;&lt;div style=&quot;color: #424037; font-family: Arial, Helvetica, sans-serif; font-size: 1.2em; line-height: 1.8em; margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;color: #424037; font-family: Arial, Helvetica, sans-serif; font-size: 1.2em; line-height: 1.8em; margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Install multitenant plugin&lt;/div&gt;&lt;div style=&quot;color: #424037; font-family: Arial, Helvetica, sans-serif; font-size: 1.2em; line-height: 1.8em; margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;grails install-plugin multi-tenant&lt;/div&gt;&lt;div style=&quot;color: #424037; font-family: Arial, Helvetica, sans-serif; font-size: 1.2em; line-height: 1.8em; margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;color: #424037; font-family: Arial, Helvetica, sans-serif; font-size: 1.2em; line-height: 1.8em; margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;install Multi-Tenant Spring Security Integration&lt;/div&gt;&lt;div style=&quot;color: #424037; font-family: Arial, Helvetica, sans-serif; font-size: 1.2em; line-height: 1.8em; margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;grails install-plugin multi-tenant-spring-security&lt;/div&gt;&lt;div style=&quot;color: #424037; font-family: Arial, Helvetica, sans-serif; font-size: 1.2em; line-height: 1.8em; margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;color: #424037; font-family: Arial, Helvetica, sans-serif; font-size: 1.2em; line-height: 1.8em; margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Add to config.groovy&lt;/div&gt;&lt;div style=&quot;color: #424037; font-family: Arial, Helvetica, sans-serif; font-size: 1.2em; line-height: 1.8em; margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;tenant {&lt;/div&gt;&lt;div style=&quot;color: #424037; font-family: Arial, Helvetica, sans-serif; font-size: 1.2em; line-height: 1.8em; margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;/span&gt;mode = &quot;multiTenant&quot; // &quot;singleTenant&quot; OR &quot;multiTenant&quot;&lt;/div&gt;&lt;div style=&quot;color: #424037; font-family: Arial, Helvetica, sans-serif; font-size: 1.2em; line-height: 1.8em; margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;/span&gt;datasourceResolver.type = &quot;db&quot;&lt;/div&gt;&lt;div style=&quot;color: #424037; font-family: Arial, Helvetica, sans-serif; font-size: 1.2em; line-height: 1.8em; margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;/span&gt;resolver {&lt;/div&gt;&lt;div style=&quot;color: #424037; font-family: Arial, Helvetica, sans-serif; font-size: 1.2em; line-height: 1.8em; margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;/span&gt;type = &quot;request&quot;&lt;/div&gt;&lt;div style=&quot;color: #424037; font-family: Arial, Helvetica, sans-serif; font-size: 1.2em; line-height: 1.8em; margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;/span&gt;resolver.request.dns.type = &quot;db&quot;&lt;/div&gt;&lt;div style=&quot;color: #424037; font-family: Arial, Helvetica, sans-serif; font-size: 1.2em; line-height: 1.8em; margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;/span&gt;request.dns.type = &quot;db&quot;&lt;/div&gt;&lt;div style=&quot;color: #424037; font-family: Arial, Helvetica, sans-serif; font-size: 1.2em; line-height: 1.8em; margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;/span&gt;}&lt;/div&gt;&lt;div style=&quot;color: #424037; font-family: Arial, Helvetica, sans-serif; font-size: 1.2em; line-height: 1.8em; margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: #424037; font-family: Arial, Helvetica, sans-serif; font-size: 1.2em; line-height: 1.8em; margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;}&lt;/div&gt;&lt;div style=&quot;color: #424037; font-family: Arial, Helvetica, sans-serif; font-size: 1.2em; line-height: 1.8em; margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;color: #424037; font-family: Arial, Helvetica, sans-serif; font-size: 1.2em; line-height: 1.8em; margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;color: #424037; font-family: Arial, Helvetica, sans-serif; font-size: 1.2em; line-height: 1.8em; margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Annotate domain classes that are to be shared after importing Multitenat annotation&lt;/div&gt;&lt;div style=&quot;color: #424037; font-family: Arial, Helvetica, sans-serif; font-size: 1.2em; line-height: 1.8em; margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;import com.infusion.tenant.groovy.compiler.MultiTenant;&lt;/div&gt;&lt;div style=&quot;color: #424037; font-family: Arial, Helvetica, sans-serif; font-size: 1.2em; line-height: 1.8em; margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;color: #424037; font-family: Arial, Helvetica, sans-serif; font-size: 1.2em; line-height: 1.8em; margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;@MultiTenant&lt;/div&gt;&lt;div style=&quot;color: #424037; font-family: Arial, Helvetica, sans-serif; font-size: 1.2em; line-height: 1.8em; margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;color: #424037; font-family: Arial, Helvetica, sans-serif; font-size: 1.2em; line-height: 1.8em; margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Add to the User Class&lt;/div&gt;&lt;div style=&quot;color: #424037; font-family: Arial, Helvetica, sans-serif; font-size: 1.2em; line-height: 1.8em; margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;/span&gt;/** for multi-tenant-acegi plugin **/&lt;/div&gt;&lt;div style=&quot;color: #424037; font-family: Arial, Helvetica, sans-serif; font-size: 1.2em; line-height: 1.8em; margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;/span&gt;Integer userTenantId&lt;/div&gt;&lt;div style=&quot;color: #424037; font-family: Arial, Helvetica, sans-serif; font-size: 1.2em; line-height: 1.8em; margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;/span&gt;Add the following constraints&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;color: #424037; font-family: Arial, Helvetica, sans-serif; font-size: 1.2em; line-height: 1.8em; margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;/span&gt;// Existing constraints&lt;/div&gt;&lt;div style=&quot;color: #424037; font-family: Arial, Helvetica, sans-serif; font-size: 1.2em; line-height: 1.8em; margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;/span&gt;userTenantId(min: 0)&lt;/div&gt;&lt;div style=&quot;color: #424037; font-family: Arial, Helvetica, sans-serif; font-size: 1.2em; line-height: 1.8em; margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: #424037; font-family: Arial, Helvetica, sans-serif; font-size: 1.2em; line-height: 1.8em; margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: #424037; font-family: Arial, Helvetica, sans-serif; font-size: 1.2em; line-height: 1.8em; margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Create a dns map table&lt;/div&gt;&lt;div style=&quot;color: #424037; font-family: Arial, Helvetica, sans-serif; font-size: 1.2em; line-height: 1.8em; margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;grails create-dns-map&lt;/div&gt;&lt;div style=&quot;color: #424037; font-family: Arial, Helvetica, sans-serif; font-size: 1.2em; line-height: 1.8em; margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;color: #424037; font-family: Arial, Helvetica, sans-serif; font-size: 1.2em; line-height: 1.8em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Now with all the setup in place you should be able to run your app with multitenancy setup.&lt;/div&gt;&lt;div style=&quot;color: #424037; font-family: Arial, Helvetica, sans-serif; font-size: 1.2em; line-height: 1.8em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #424037; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 19px; line-height: 34px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/article&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://springandgrailsmusings.blogspot.com/feeds/2627420547459928505/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://springandgrailsmusings.blogspot.com/2010/12/grails-and-multi-tenancy-multi-tenancy.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6203993754213672453/posts/default/2627420547459928505'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6203993754213672453/posts/default/2627420547459928505'/><link rel='alternate' type='text/html' href='http://springandgrailsmusings.blogspot.com/2010/12/grails-and-multi-tenancy-multi-tenancy.html' title='Grails and multi tenancy  - Multi tenancy setup with grails'/><author><name>trbala(Bala Thiruppanambakkam)</name><uri>http://www.blogger.com/profile/05837199969474593390</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6203993754213672453.post-2848376223565816728</id><published>2010-12-08T17:00:00.000-08:00</published><updated>2010-12-08T17:00:58.696-08:00</updated><title type='text'>Grails and Jasper Reports - Issue with Utf-8 when designing reports with iReport</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #424037; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;header style=&quot;display: block; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 5px; width: 655px;&quot;&gt;&lt;h1 style=&quot;float: left; letter-spacing: -1px; line-height: 1em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 12px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; width: 500px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Jasper reports works perfectly well with grails. However I ran into some issues designing the report layout with iReport, the default designer for Jasper Reports and trying to integrate it with my grails based application. Here is the issue and solution in the hope that it is useful to others who run into this.&lt;/span&gt;&lt;/span&gt;&lt;/h1&gt;&lt;h1 style=&quot;float: left; letter-spacing: -1px; line-height: 1em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 12px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; width: 500px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Please leave a note if you find this post useful or if you would like me to write something specific about grails or spring.&lt;/span&gt;&lt;/span&gt;&lt;/h1&gt;&lt;div style=&quot;font-size: 10px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;editbox&quot; style=&quot;font-size: 10px; height: 16px; left: 155px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; position: absolute; top: 0px; visibility: hidden;&quot;&gt;&lt;ul class=&quot;mini_commands posterous_edit_box&quot; data-posterous-edit-box=&quot;true&quot; data-posterous-post-id=&quot;29275072&quot; style=&quot;cursor: pointer; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;li style=&quot;cursor: pointer; display: inline; font-size: 10px; list-style-type: none; margin-bottom: 0px; margin-left: 0px; margin-right: 10px; margin-top: 5px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;a href=&quot;http://posterous.com/posts/edit/29275072&quot; style=&quot;color: #aaaaaa; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: none;&quot;&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li style=&quot;cursor: pointer; display: inline; font-size: 10px; list-style-type: none; margin-bottom: 0px; margin-left: 0px; margin-right: 10px; margin-top: 5px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;a data-posterous-confirm=&quot;Are you sure you want to delete this post?&quot; data-posterous-delete-link=&quot;true&quot; href=&quot;http://trbala.posterous.com/posts/destroy/29275072&quot; style=&quot;color: #aaaaaa; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: none;&quot;&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li style=&quot;cursor: pointer; display: inline; font-size: 10px; list-style-type: none; margin-bottom: 0px; margin-left: 0px; margin-right: 10px; margin-top: 5px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;a data-posterous-post-id=&quot;29275072&quot; data-posterous-tag-modal=&quot;true&quot; href=&quot;http://trbala.posterous.com/29275072#&quot; id=&quot;tag_link_id_29275072&quot; style=&quot;color: #aaaaaa; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: none;&quot;&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li style=&quot;cursor: pointer; display: inline; font-size: 10px; list-style-type: none; margin-bottom: 0px; margin-left: 0px; margin-right: 10px; margin-top: 5px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;a data-posterous-autopost-modal=&quot;true&quot; data-posterous-post-id=&quot;29275072&quot; href=&quot;http://trbala.posterous.com/29275072#&quot; id=&quot;crosspost_link_id_29275072&quot; style=&quot;color: #aaaaaa; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: none;&quot;&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;&lt;/header&gt;&lt;div class=&quot;body&quot; style=&quot;display: inline; float: right; font-size: 1.2em; line-height: 1.8em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; width: 500px;&quot;&gt;&lt;div class=&quot;inner&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;div style=&quot;color: #5e5e5e; display: block; font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 1.5em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0pt; padding-left: 0pt; padding-right: 0pt; padding-top: 0pt;&quot;&gt;Jasperreports complains with utf-8 issue when it tries to render the report.&lt;/div&gt;&lt;div style=&quot;color: #5e5e5e; display: block; font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 1.5em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0pt; padding-left: 0pt; padding-right: 0pt; padding-top: 0pt;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;color: #5e5e5e; display: block; font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 1.5em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0pt; padding-left: 0pt; padding-right: 0pt; padding-top: 0pt;&quot;&gt;Problem can be solved adding parameter -Dfile.encoding=UTF-8 to the&amp;nbsp;&lt;span class=&quot;yshortcuts&quot; style=&quot;line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;VM&lt;/span&gt;.&lt;/div&gt;&lt;div style=&quot;color: #5e5e5e; display: block; font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 1.5em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0pt; padding-left: 0pt; padding-right: 0pt; padding-top: 0pt;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;color: #5e5e5e; display: block; font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 1.5em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0pt; padding-left: 0pt; padding-right: 0pt; padding-top: 0pt;&quot;&gt;To add parameter edit etc/ireport.conf,&lt;/div&gt;&lt;div style=&quot;color: #5e5e5e; display: block; font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 1.5em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0pt; padding-left: 0pt; padding-right: 0pt; padding-top: 0pt;&quot;&gt;Modify &#39;default_options&#39; parameter it should look like this:&lt;/div&gt;&lt;div style=&quot;color: #5e5e5e; display: block; font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 1.5em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0pt; padding-left: 0pt; padding-right: 0pt; padding-top: 0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; default_options=&quot;-J-Dfile.encoding=UTF-8 -J-Xms256M -J-Xmx512M&quot;&lt;/div&gt;&lt;div style=&quot;color: #5e5e5e; display: block; font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 1.5em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0pt; padding-left: 0pt; padding-right: 0pt; padding-top: 0pt;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;color: #5e5e5e; display: block; font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 1.5em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0pt; padding-left: 0pt; padding-right: 0pt; padding-top: 0pt;&quot;&gt;Now the reports render perfectly - Enjoy!&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://springandgrailsmusings.blogspot.com/feeds/2848376223565816728/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://springandgrailsmusings.blogspot.com/2010/12/grails-and-jasper-reports-issue-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6203993754213672453/posts/default/2848376223565816728'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6203993754213672453/posts/default/2848376223565816728'/><link rel='alternate' type='text/html' href='http://springandgrailsmusings.blogspot.com/2010/12/grails-and-jasper-reports-issue-with.html' title='Grails and Jasper Reports - Issue with Utf-8 when designing reports with iReport'/><author><name>trbala(Bala Thiruppanambakkam)</name><uri>http://www.blogger.com/profile/05837199969474593390</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6203993754213672453.post-665439161231104130</id><published>2010-12-08T16:49:00.001-08:00</published><updated>2010-12-08T16:53:49.661-08:00</updated><title type='text'>Grails : Scheduling jobs with Quartz</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #424037; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 21px;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;b&gt;&lt;u&gt;Had taken the time and integrated quartz with grails.&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;b&gt;&lt;u&gt;Thought I will share it.&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: underline;&quot;&gt;&lt;strong style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;In this post I will discuss how to&amp;nbsp;&lt;/strong&gt;&lt;/span&gt;Install and configure quartz with jobs persistent in a database( mysql)&lt;/div&gt;&lt;div style=&quot;margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;1.&lt;/div&gt;&lt;div style=&quot;margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Get quartz distribution.&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;Unzip to a directory.&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;Run the table-creation SQL scripts in the &quot;docs/dbTables&quot; directory of the Quartz distribution&lt;/div&gt;&lt;div style=&quot;margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;2.Install quartz plugin&lt;/div&gt;&lt;div style=&quot;margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;em style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;grails install-plugin quartz&lt;/em&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;3.&lt;/div&gt;&lt;div style=&quot;margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Create a file,&amp;nbsp;&lt;em style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;QuartzConfig.groovy&lt;/em&gt;&amp;nbsp;in grails-app\conf&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;Specify quartz startup and storage options here like this:&lt;/div&gt;&lt;div style=&quot;margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;quartz {&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; autoStartup = true&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; jdbcStore = true&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; waitForJobsToCompleteOnShutdown = true&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;}&lt;/div&gt;&lt;div style=&quot;margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;environments {&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; test {&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; quartz {&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; autoStartup = true&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;}&lt;/div&gt;&lt;div style=&quot;margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;4.&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;Create a file,&amp;nbsp;&lt;em style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;quartz.properties&lt;/em&gt;&amp;nbsp;in grails-app\conf&amp;nbsp;&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;Configure your db name in URL as well as user name and password&lt;/div&gt;&lt;div style=&quot;margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;org.quartz.scheduler.rmi.export = false&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;org.quartz.scheduler.rmi.proxy = false&lt;/div&gt;&lt;div style=&quot;margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;org.quartz.threadPool.threadCount = 3&lt;/div&gt;&lt;div style=&quot;margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;org.quartz.jobStore.class = org.quartz.impl.jdbcjobstore.JobStoreTX&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;org.quartz.jobStore.driverDelegateClass =&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;org.quartz.impl.jdbcjobstore.StdJDBCDelegate&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;org.quartz.jobStore.tablePrefix = QRTZ_&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;org.quartz.jobStore.dataSource = prodDataSource&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;org.quartz.jobStore.isClustered = false&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;org.quartz.dataSource.prodDataSource.driver = com.mysql.jdbc.Driver&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;org.quartz.dataSource.prodDataSource.URL = &quot;jdbc:mysql://localhost:3306/xxx?autoreconnect=true&quot;&amp;gt;org.quartz.dataSource.prodDataSource.user=grails&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;org.quartz.dataSource.prodDataSource.password =&quot;server&quot;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;5.&lt;/div&gt;&lt;div style=&quot;margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;In&amp;nbsp;&lt;em style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;resources.groovy&lt;/em&gt;&amp;nbsp;in grails-app\conf\spring&lt;/div&gt;&lt;div style=&quot;margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;add the imports:&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;import org.springframework.scheduling.quartz.SchedulerFactoryBean&amp;nbsp;&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;import org.codehaus.groovy.grails.jobs.*&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;import org.codehaus.groovy.grails.plugins.quartz.listeners.*&lt;/div&gt;&lt;div style=&quot;margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;add this to spring beans dsl:&lt;/div&gt;&lt;div style=&quot;margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;quartzScheduler(SchedulerFactoryBean) {&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;autoStartup = false&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;dataSource = ref(&#39;dataSource&#39;)&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;transactionManager = ref(&#39;transactionManager&#39;)&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;configLocation = &#39;classpath:quartz.properties&#39;&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;jobFactory = ref(&#39;quartzJobFactory&#39;)&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;jobListeners = [ref(&quot;${SessionBinderJobListener.NAME}&quot;)]&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;globalJobListeners = [ref(&quot;${ExceptionPrinterJobListener.NAME}&quot;)]&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;}&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;6.&lt;/div&gt;&lt;div style=&quot;margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Create a service class(or where you would prefer to do this) with grails create-service&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;Enable the service class to be injeced with a scheduler by declaring like this&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; def quartzScheduler&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;define a method which will do the scheduling for you.&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;In this eg I put in a domain object for later retrieval during job execution.&lt;/div&gt;&lt;div style=&quot;margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; def schedule(my.Motd m) {&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // execute task&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; def jobDetail = new JobDetail(m?.message, group, MotdJob.class);&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; jobDetail.getJobDataMap().put(&quot;job&quot;, m)&lt;/div&gt;&lt;div style=&quot;margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SimpleDateFormat formatter&amp;nbsp; = new SimpleDateFormat (&quot;yyyy.MM.dd hh:mm:ss&quot;);&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date myDate = formatter.parse(&quot;2010.07.02 15:13:56&quot;);&lt;/div&gt;&lt;div style=&quot;margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; def myTrigger = new SimpleTrigger(&quot;myTrigger&quot; + new Random().nextInt().toString(), &quot;mygroup&quot; + new Random().nextInt().toString(),&amp;nbsp; myDate,null,0,0)&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; quartzScheduler.scheduleJob(jobDetail, myTrigger);&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/div&gt;&lt;div style=&quot;margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;7.&lt;/div&gt;&lt;div style=&quot;margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Create a quartz job using&amp;nbsp;&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;grails create-job fully-qualified-job-name&lt;/div&gt;&lt;div style=&quot;margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;In this class define a execute method and implement your business logic&lt;/div&gt;&lt;div style=&quot;margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; void execute(JobExecutionContext context) {&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;String instName = context.getJobDetail().getName();&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;println &quot;I have been triggered to run instGroup&quot;&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;String instGroup = context.getJobDetail().getGroup();&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; JobDataMap dataMap = context.getJobDetail().getJobDataMap();&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; def mo =dataMap.get(&quot;job&quot;)&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; if(mo) {&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Motd m = (Motd)mo&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; else&amp;nbsp;&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; println &quot;null job&quot;&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; return&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/div&gt;&lt;div style=&quot;margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;8.&lt;/div&gt;&lt;div style=&quot;margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;If you job uses a domain class (like in example above) you need to create a jar with all the domain class used by quartz and add this to your lib directory&lt;br style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;NOTE: This is at best a hack solution. Better option is doing this through classloader. But I wont go into it.&lt;/div&gt;&lt;div style=&quot;margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Thats it.&lt;/div&gt;&lt;div style=&quot;margin-bottom: 18px; margin-left: 0px; margin-right: 0px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Enjoy and email me at trbala attherateof yahoo.com if you need an exmaple source or if you can offer me a good paying job in siliconvalley!!!&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://springandgrailsmusings.blogspot.com/feeds/665439161231104130/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://springandgrailsmusings.blogspot.com/2010/12/grails-scheduling-jobs-with-quartz.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6203993754213672453/posts/default/665439161231104130'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6203993754213672453/posts/default/665439161231104130'/><link rel='alternate' type='text/html' href='http://springandgrailsmusings.blogspot.com/2010/12/grails-scheduling-jobs-with-quartz.html' title='Grails : Scheduling jobs with Quartz'/><author><name>trbala(Bala Thiruppanambakkam)</name><uri>http://www.blogger.com/profile/05837199969474593390</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>