Grails on Jelastic
As Jelastic continues to grow, we want to continue to share with you new features, how to’s and updates. Today, we want to show you how Grails works within Jelastic. Grails is an innovative, high-productivity framework that follows the principle of “Convention over Configuration,” making it quite popular. It provides a stand-alone development environment while maintaining a simplicity that allows the developer to focus on what really matters: creating high quality, easy to use applications that users love. Grails supplements Java application development quite easily because it is built on Spring and based on Groovy.
So, how do you get all the benefits of using Grails and the Cloud? Easy. Use Jelastic!
1. Create the Application
- Go to grails.org and download the lastest version of Grails.
- Unzip the package you have just downloaded.
- Add the environment variables (this step is optional):
- GRAILS_HOME (…\grails-1.3.7) specifys to the path where you extracted the archive;
- PATH (…\grails-1.3.7\bin) contains the path to the bin directory.
- Create your app using the command line.
- Create .war archive with just one command:
- Go to jelastic.com and sign up if you haven’t done so yet (you can do this on Servint or Host Europe servers), or log in with your Jelastic credentials by clicking the Sign In link on the page.
- Use Jelastic to create a new environment.
- In the Environment topology dialog pick your application server (e.g. Tomcat 6) and type your environment name, for example, Grails, then click on Create button.
- Upload your WAR file to the Deployment manager.
- Once the package uploaded to Jelastic, deploy it to your environment.
…\grails-1.3.7\bin\grails war {app_name}.war
2. Create the Environment
3. Upload the Java Package
That’s it. Launch your application and enjoy!








Blog
Twitter
YouTube
Facebook
Google+
Habrahabr
approve that it is very easy to deploy grails war to jelastic. Did it for our direct-feedback.com. Thank you for the service!
Thanks for good words!
I second this article. It is just too easy deploying trails apps to jelastic. One tip to remember is to enable external configuration in config.groovy to allow you easily change configuration and such without re-uploading the war file! Time saver!
Thanks for your suggestion! You can add it to our voting list http://jelastic.com/?features
Thanks for the tip Manners O! Where in the jelastic env can you store that external config? Among the tomcat conf?
Hi, David!
You can store such files in a home directory.
Great article, great platform am loving it
Thanks for your feedback!
external configs helps a lot !
my application is failing to show anything am using grails 2.0 and l followed the details in this tutorial
Hi! We have to know the name of your environment to help you.
http://youshout.jelastic.com/
We are trying to fix this problem now. Sorry for the delay!
Have you got any feedback for me
Can you send us your database connection string?
grails {
mongo {
host = “localhost”
port = 27107
username = “youshout”
password = “youshout”
databaseName = “youshout-db”
}
}
You should change: host=”mongodb-{your app name}.jelastic.servint.net” if you use Servint
or host=”mongodb-{your app name}.jelastic.com” if you use HE
I am currently hosting 2 grails applications on Jelastic and aside from occasional stability hiccups, it is turning out to be quite a good platform.
If you redeploy your application often like I do, you may want to copy the grails libs to your Jelastic environment to avoid transferring >40MB.
The easy way is to build you app (grails war) and copy all of the libs you find in ${war.file}/WEB-INF/lib to ${tomcat}/lib on Jelastic. (Please implement the feature to be able to upload a zip and upzip it on Jelastic; it took me ages to copy the 77 libraries due to transfer errors and such; I already voted for the feature).
Then when you build your app, simply run
grails prod war –nojars
And you’ll save yourself heaps of time and bandwidth.
there are 2 hyphens in nojars, as in:
grails prod war –nojars
Hello, Marcin!
Thanks for your feedback and suggestion! We appreciate you using Jelastic!
Hello Marina,
I’m having some problems deploying the most basic grails 2.0 application (the one explain in this post). I’m getting the following error: page temporarily unavailable.
Can you hep me? My environment is http://rchavarria-jelastic-test.jelastic.com
Thanks in advance.
Hello!
Increase your limit, please: one cloudlet is not enough for your application. And redeploy your app one more time. It’ll help.