Welcome Grails 2

Posted by Anantha Narayanan On 1:01 AM 4 comments

It was only recently that Grails 2 was released. Being using an ubuntu Linux distro, it is very easy to upgrade Grails and I did.

The first thing I tried was to execute an already existing application (using Grails 1.3.7) and it gave me an error:

| NOTE: Your application currently expects grails version [1.3.7], this target will upgrade it to Grails 2.0.0

I issued the command grails upgrade

WARNING: This target will upgrade an older Grails application to 2.0.0.
  Are you sure you want to continue? [y,n]

I gave a proceed signal and Grails upgraded my application after downloading necessary files. Pretty impressive.
When I executed the application using run-app I got the following error:
| Error 2011-12-20 00:35:57,627 [Thread-7] ERROR context.GrailsContextLoader - Error executing bootstraps: Database driver [org.hsqldb.jdbcDriver] for HSQLDB not found. Since Grails 2.0 H2 is now the default database. You need to either add the 'org.h2.Driver' class as your database driver and change the connect URL format (for example 'jdbc:h2:mem:devDb') in DataSource.groovy or add HSQLDB as a dependency of your application.

He he, looking complex. Do not worry. There is one change that Grails 2 is shipped with. Grails 1.3.7 was using HSQLDB and Grails 2 uses H2 database. The reference to HSQLDB made Grails to spit this error message.

But Grails also has pointed out as to how to solve it.
  1. Modify the org.hsqldb.jdbcDriver with org.h2.Driver in driverClassName.
  2. Modify url = "jdbc:hsqldb:mem:devDB" with url = "jdbc:h2:mem:devDb"
That's it. I was able to execute the application, though I did not appreciate any interface facelift with my old application. Now I created a new application and created a domain class and a controller for it.

When executed the HTML5 styling was what I was expecting. Yes and I got it. So this is another change in Grails 2.

For more about Grails 2, check here.

If you like my blog, please leave your valuable suggestions below.

4 comments:

Just had the same problem - thanks for the useful pointer!

glad to know that it solved your problem...thanks for letting me know

I 'm using sts eclipse. I got past that error thanks to your blog post.
Now the question is do I need to enable hiberate? I 'm getting errors for
cache.provider_class='com.opensymphony.oscache.hibernate.OSCacheProvider'

@Douglas see if this link is of any use to you: http://grails.1312388.n4.nabble.com/EhCache-and-OSCache-no-longer-default-dependencies-in-Grails-1-2-td1391767.html

Post a Comment

Recommended Post Slide Out For Blogger