Wednesday, July 25, 2012

Vaadin + Spring + MongoDB...on the cloud!

Hi all, in this post I want to publicize a little experiment I had with the cloud platform from VMWare, CloudFoundry http://www.cloudfoundry.com. The application deployed as example is an evolution of Vaadin Address Book (http://demo.vaadin.com/AddressBook) that is a CRUD application based on Vaadin and JPA. This is the list of modifications I've done on the original application:

  • Spring 3.1 integration
  • JPA implementation switched to Hibernate 4 (original was EclipseLink)
  • Added a document manager feature (upload/download/delete), that stores files with MongoDB GridFS implementation
  • Automatic configuration switch (development / cloud) using Spring 3.1 profiles
  • Integration with Vaadin addon vaadin-lazyquerycontainer https://vaadin.com/directory#addon/lazy-query-container
I found CloudFoundry very easy to use, especially with the Eclipse plugin (http://docs.cloudfoundry.com/tools/STS/configuring-STS.html#installing-the-cloud-foundry-integration-extension-in-eclipse). You can run your app in the same way you do with a generic web application in Eclipse.

I have shared the project on GitHub (https://github.com/cecchisandrone/cloudfoundry). Feel free to download it and try on the cloud! A guide to deploy the app on CloudFoundry can be found here: http://docs.cloudfoundry.com/tools/deploying-apps.html

Note: before starting the project as webapp (in the cloud or locally), please edit the services.properties file. It contains configurations parameters, especially for services on cloud and databases.

No comments:

Post a Comment