Skip to content

Grails on Jelastic

by on January 24, 2012

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

  1.  Go to grails.org and download the lastest version of Grails.
  2. Unzip the package you have just downloaded.
  3. 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.
  4. Create your app using the command line.
  5. With environment variables (C:\grails on Windows,~/grails on Linux):
    …\grails-1.3.7 grails create-app {app_name} 

    Without environment variables:
    \grails-1.3.7\bin\grails create-app {app_name} 
    NOTE: application will be created in directory C:\grails-1.3.7\bin\{app_name}
  6. Create .war archive with just one command:
  7. With environment variables (C:\grails on Windows,~/grails on Linux):

    …\grails-1.3.7\{app_name} grails war {app_name}.war  

    Without environment variables (C:\grails on Windows,~/grails on Linux):
    …\grails-1.3.7\bin\{app_name} 
    …\grails-1.3.7\bin\grails war {app_name}.war
    WAR archive will be saved at C:\grails-1.3.7\bin\{app_name}\

2. Create the Environment

  1. 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.
  2. Use Jelastic to create a new environment.
  3. 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.
  4. It will take just a minute for your environment to be created.

3. Upload the Java Package

  1. Upload your WAR file to the Deployment manager.  
  2. Once the package uploaded to Jelastic, deploy it to your environment.

That’s it. Launch your application and enjoy!

From → Announcements, HowTo

24 Comments
  1. approve that it is very easy to deploy grails war to jelastic. Did it for our direct-feedback.com. Thank you for the service!

  2. 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!

  3. Great article, great platform am loving it

  4. external configs helps a lot !

  5. my application is failing to show anything am using grails 2.0 and l followed the details in this tutorial

  6. 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.

  7. 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.

Trackbacks & Pingbacks

  1. » Blog Archive
  2. An Army of Solipsists » Blog Archive » This Week in Grails (2012-04)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 95 other followers