Grails 1.1.1 released with Google AppEngine support |
|

Today we are pleased to announce the availability of Grails 1.1.1 which whilst providing many incremental improvements over Grails 1.1 also introduces official support for Google AppEngine.
Groovy itself has been running on AppEngine since its launch, but we had to make a few tweaks here and there in Grails to make Grails applications run on AppEngine.
Included in this is the introduction of an AppEngine plugin which replaces Hibernate with JDO (and soon JPA) for persistence in order to take advantage of Google's DataStore API. The AppEngine plugin also integrates the AppEngine development environment with Grails so that you can run your Grails application locally inside the AppEngine container whilst still benefiting from hot reloading support.
Getting Started
As with many things in Grails the ease of use is something best demonstrated visually, hence we have prepared a screencast demonstrating creating a Grails application and deploying to Google AppEngine using the AppEngine plugin. Simply click on the image below to start the screencast:
For even more information there are detailed step-by-step instructions on how to create and deploy a Grails application to Google AppEngine on the AppEngine plugin page.
The Future
The Grails and AppEngine combination is already the most productive combination you can use to deploy Java applications to AppEngine, but we are not finished yet. We are hard at work on building GORM-like abstractions over JPA and JDO in order to bring productivity enhancements to the AppEngine DataStore API and users of JPA/JDO in general.
Luckily since Groovy produces valid Java bytecode we are able to take advantage of all of the AppEngine features and tools such as the DataNucleus Enhancer. The ultimate goal is to make Grails the primary environment for building applications targeting the AppEngine Java SDK and a real viable alternative from a productivity standpoint to the Python SDK. What we have introduced today is a great step in that direction.
Resources
- Google AppEngine – http://appengine.google.com
- Grails 1.1.1 – http://grails.org/Download
- Grails AppEngine Plugin – http://grails.org/plugin/app-engine
- Grails Documentation – http://grails.org/doc/1.1.x
Similar Posts
- Using Micro Cloud Foundry from Grails
- Cloud Foundry integrated into developer tools
- Countdown to Grails 2.0: User experience
- Managing plugins with Grails 1.3
- Write your Google App Engine applications in Groovy






Lukasz Matuszewski says:
Added on May 14th, 2009 at 11:37 amGreat news!
We are looking forward to see all Grails features on GAE.
Daniel Labrosse says:
Added on May 14th, 2009 at 1:00 pmTaking it for a test drive now.
thanks a lot!
Matthew Adams says:
Added on May 14th, 2009 at 1:00 pmThis is really great news! Thanks, Grails team!
Does the JDO support mean that I can configure Grails to use JDO outside of the AppEngine as well, or should I wait for the JDO/JPA abstraction layer?
-matthew
Graeme Rocher says:
Added on May 14th, 2009 at 2:13 pmYou could do this before, Grails is afterall just Spring so you can configure whatever you want. All you have to do first is uninstall the Hibernate plugin
grails uninstall-plugin hibernate
And then you can configure JDO inside your application. The AppEngine plugin configures JDO for you, we could write a more general purpose plugin for configuring JDO too.
Matthew Adams says:
Added on May 14th, 2009 at 2:50 pmA more general purpose plug-in for configuring JDO would be great to have.
Jan Vissers says:
Added on May 14th, 2009 at 3:06 pmI've tried to follow along with the screen case but have a number of issues.
First after I create the domain class and perform generate-all I get:
groovy.lang.GroovyRuntimeException: Failed to parse template script (your template may contain an error or be trying to use expressions not currently supported): startup failed, Si
mpleTemplateScript1.groovy: 2: unable to resolve class org.codehaus.groovy.grails.orm.hibernate.support.ClosureEventTriggeringInterceptor
@ line 2, column 16.
1 error
at _GrailsGenerate_groovy.generateForDomainClass(_GrailsGenerate_groovy:85)
at _GrailsGenerate_groovy$_run_closure1.doCall(_GrailsGenerate_groovy:50)
at GenerateAll$_run_closure1.doCall(GenerateAll.groovy:42)
at gant.Gant$_dispatch_closure4.doCall(Gant.groovy:324)
at gant.Gant$_dispatch_closure6.doCall(Gant.groovy:334)
at gant.Gant$_dispatch_closure6.doCall(Gant.groovy)
at gant.Gant.withBuildListeners(Gant.groovy:344)
at gant.Gant.this$2$withBuildListeners(Gant.groovy)
at gant.Gant$this$2$withBuildListeners.callCurrent(Unknown Source)
at gant.Gant.dispatch(Gant.groovy:334)
at gant.Gant.this$2$dispatch(Gant.groovy)
at gant.Gant.invokeMethod(Gant.groovy)
at gant.Gant.processTargets(Gant.groovy:495)
at gant.Gant.processTargets(Gant.groovy:480)
Error running generate-all: Failed to parse template script (your template may contain an error or be trying to use expressions not currently supported): startup failed, SimpleTemplateScript1.groovy: 2: unable to resolve class org.codehaus.groovy.grails.orm.hibernate.support.ClosureEventTriggeringInterceptor
@ line 2, column 16.
1 error
Trying to deploy an empty skeleton app to app engine (with GAE SDK 1.2.1) – so no domain classes et cetera gives me:
C:\dev\grails\grails-1.1.1\projects\jan-vissers>%APPENGINE_HOME%\bin\appcfg update .\target\war
Email: **********
Reading application configuration data…
Bad configuration: XML error validating .\target\war\WEB-INF\datastore-indexes.xml against C:\dev\gae\appengine-java-sdk-1.2.1\docs\datastore-indexes.xsd
Caused by: cvc-elt.1: Cannot find the declaration of element 'datastore-indexes'.
I must be doing something. But what?
Thomas Risberg says:
Added on May 14th, 2009 at 5:22 pmI hit the same issue with the generate-all command. I simply installed the hibernate plugin again, ran the generate-all and then uninstalled the hibernate plugin.
I'm using the 1.2.1 version of the AppEngine SDK and got the following error trying to update the app:
$ /Developer/Google/appengine-java-sdk-1.2.1/bin/appcfg.sh update target/war/
Reading application configuration data…
Bad configuration: XML error validating target/war/WEB-INF/datastore-indexes.xml against /Developer/Google/appengine-java-sdk-1.2.1/docs/datastore-indexes.xsd
Caused by: cvc-elt.1: Cannot find the declaration of element 'datastore-indexes'.
Please see the logs [/tmp/appcfg32522.log] for further information.
I got around that by removing the target/war/WEB-INF/datastore-indexes.xml file before updating.
So here is my command sequence:
grails create-app springdeveloper-music-store
cd springdeveloper-music-store/
grails uninstall-plugin hibernate
grails install-plugin app-engine
export APPENGINE_HOME=/Developer/Google/appengine-java-sdk-1.2.1
grails create-domain-class com.springdeveloper.music.Album
grails install-plugin hibernate
grails generate-all com.springdeveloper.music.Album
grails uninstall-plugin hibernate
grails app-engine package
rm target/war/WEB-INF/datastore-indexes.xml
/Developer/Google/appengine-java-sdk-1.2.1/bin/appcfg.sh update target/war/
-Thomas
Carlos Perez says:
Added on May 14th, 2009 at 6:14 pmMindboggling cool! Should definitely put Grails on everyone's radar screen.
Arulazi Dhesiaseelan says:
Added on May 14th, 2009 at 10:56 pmNice work! I managed to deploy with just couple changes to the steps on my windows box.
1. grails app-engine (CTRL C, would not kill the process used by com.google.appengine.tools.development.DevAppServerMain, so this would interfere in subsequent startups if unnoticed. I had to kill manually.)
2. GroovyRuntimeException seems to be a bug and the resolution discussed here (
http://www.nabble.com/generate-views-error-for-plugin-dev-in-grails-1.1-td22856663.html) works. The steps I had to follow was:
grails install-plugin hibernate
grails generate-all com.bookstore.Book
grails uninstall-plugin hibernate
grails app-engine
My app is live @ http://book-store.appspot.com/book/list
Thanks Grails team for this neat integration with App-engine.
-Arul
Jan Vissers says:
Added on May 15th, 2009 at 1:50 amThanks guys (Thomas/Arulazi) – got it working now.
Pieter Coucke says:
Added on May 15th, 2009 at 7:19 amVery nice work!
The thing is, I finally started to "get" Python and I created a mashup with it (http://my-favorite-places.appspot.com/). The day I gave a demo about it at work, the AppEngine Java SDK was released, so learning Python wasn't really necessary (but a nice addition to my knowledge anyway).
Today I converted the app to Grails, which you can see here:
http://favorite-places.appspot.com/
I also had the problem with target/war/WEB-INF/datastore-indexes.xml which needs to be removed before uploading to AppEngine.
Roger says:
Added on May 19th, 2009 at 8:43 amThomas – heh.. thanks for the instructions for the workaround.
Now, to the real issue..
Could we somehow, slowdown releases? I mean, it seems that right now there is a mad rush to be able to twitter "we did it!" when in fact.. as Thomas's post indicates.. that actual solution is very very far from done.
Grails, to me, is this massive performance enhancing tool.. and right now, it seems like it is 20 hours a week, late at night, moving sideways and not forward at all
bendanpa says:
Added on June 3rd, 2009 at 1:51 pmHi Grocher,
I am working on web app slowly at my spare time. Right now I am using grails 1.04 mySql running on Ubuntu 8.10. This project is still at its early stage and expected to launch in about one year. Now since grails 1.1.1 starts to support google app engine, I am very excited about what you did and thinking about to make a move.
Would you please give me some advices if I should make the move?
Thanks,
Bendanpa
gapes says:
Added on July 10th, 2009 at 2:16 pmHi,
I read all the posts here and try to solve problem occurred when running the default application created by the following sequence.
grails create-app test
cd test
grails uninstall-plugin hibernate
grails install-plugin app-engine
grails create-domain-class com.test.User
grails install-plugin hibernate
grails generate-all com.test.User
grails uninstall-plugin hibernate
grails app-engine run
Question 1: I selected JPA when installing app-engine, but this line
"Configuring JDO for AppEngine"
appeared in the output after I ran "grails app-engine run".
Is this a bug?
Question 2: Now the last line of the output says open the browser and goto
"http://localhost:8080/"
When I do that, the browser page shows "Grails Runtime Exception"
and the windows console shows a bunch of exceptions, here is some of it.
WARNING: EXCEPTION
org.springframework.web.util.NestedServletException: Request process
ing failed; nested exception is org.codehaus.groovy.grails.web.mapping.exception
s.UrlMappingException: Error mapping onto view [/error]: Error evaluating expres
sion [request.'javax.servlet.error.message'.encodeAsHTML()] on line [31]: java.l
ang.NoClassDefFoundError: Could not initialize class org.springframework.web.uti
l.HtmlUtils
at org.springframework.web.servlet.FrameworkServlet.processReque
st(FrameworkServlet.java:583)
at org.springframework.web.servlet.FrameworkServlet.doGet(Framew
orkServlet.java:501)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:693)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.
java:487)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandle
r.java:362)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHan
dler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandle
r.java:181)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandle
r.java:712)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.j
ava:405)
at com.google.apphosting.utils.jetty.DevAppEngineWebAppContext.h
andle(DevAppEngineWebAppContext.java:54)
I am using Grails 1.1.1 and app-engine-0.8.3.
I just want to make the default application with views running on my local windows. I had a success without view created.
Can someone show a simple tutorial to do that?
Thanks,
gapes
exn says:
Added on April 23rd, 2010 at 12:37 pmIt simple does not work properly with gae.
Only one time in my experience with grails gae it does not thrown the 500 error.. one time it were working and displayed hello world. I more see no reason to play with grails..
Robinfung says:
Added on June 9th, 2010 at 12:18 pmtom ur solution work fine. but let me check it in the real environment later. thanks