In the Cloud

Solving problems using cloud computing…

Archive for the 'Groovy' Category

SpringSource dm Server, Groovy and Grails: coding in the fast lane?

Lately, I have been reading a lot on various technical topics. Usually, after my reading session, I try to find out how to mix good products and/or tools for the benefits not just to add up, but to multiply.

The latest products and tools I have been examining are these:

I am not going to rephrase all that is marketed as shiny and exciting since you can read that on the respective web sites. What I will do here is finding out how close I can get to building a simple web application in Grails, using a backend service written in Groovy, where both modules are OSGi bundles and both deployed on the SpringSource dm Server.

Let’s start with the setup of all our tools!

First of all, go to the SpringSource website and download the Community edition of SpringSource dm Server. Follow the installation instructions, and launch the server. Here is the output you should get:

AtrisoBook:springsource-dm-server-1.0.0.RELEASE ringods$ bin/startup.sh
[2008-10-31 17:28:59.097] main                     <SPKB0001I> Server starting.
[2008-10-31 17:28:59.584] main                     <SPOF0001I> OSGi telnet console available on port 2401.
[2008-10-31 17:29:01.990] main                     <SPKE0000I> Boot subsystems installed.
[2008-10-31 17:29:02.817] main                     <SPKE0001I> Base subsystems installed.
[2008-10-31 17:29:03.962] server-dm-2              <SPPM0000I> Installing profile 'web'.
[2008-10-31 17:29:04.771] server-dm-2              <SPPM0001I> Installed profile 'web'.
[2008-10-31 17:29:04.860] server-dm-4              <SPSC0001I> Creating HTTP/1.1 connector with scheme http on port 8080.
[2008-10-31 17:29:04.889] server-dm-4              <SPSC0001I> Creating HTTP/1.1 connector with scheme https on port 8443.
[2008-10-31 17:29:04.905] server-dm-4              <SPSC0001I> Creating AJP/1.3 connector with scheme http on port 8009.
[2008-10-31 17:29:04.930] server-dm-4              <SPSC0000I> Starting ServletContainer.
[2008-10-31 17:29:05.417] server-dm-13             <SPPM0002I> Server open for business with profile 'web'.
[2008-10-31 17:29:05.435] fs-watcher               <SPDE0048I> Processing 'INITIAL' event for file 'server.admin.web-1.0.0.RELEASE.jar'.
[2008-10-31 17:29:06.243] fs-watcher               <SPSC1000I> Creating web application '/admin'.
[2008-10-31 17:29:06.638] async-delivery-thread-1  <SPSC1001I> Starting web application '/admin'.
[2008-10-31 17:29:07.044] fs-watcher               <SPDE0010I> Deployment of 'com.springsource.server.servlet.admin' version '1.0.0.RELEASE' completed.
[2008-10-31 17:29:07.048] fs-watcher               <SPDE0048I> Processing 'INITIAL' event for file 'server.admin.splash-1.0.0.RELEASE.war'.
[2008-10-31 17:29:07.582] fs-watcher               <SPSC1000I> Creating web application '/'.
[2008-10-31 17:29:07.714] async-delivery-thread-1  <SPSC1001I> Starting web application '/'.
[2008-10-31 17:29:07.878] fs-watcher               <SPDE0010I> Deployment of 'com.springsource.server.servlet.splash' version '0' completed.

So far so good! Now shutdown it again. During development, we will launch the server from within Eclipse.

Next step is to get our developer tools up and running. At the time of writing, I downloaded Eclipse Ganymede 3.4.1 (SR1) JEE edition. Launch Eclipse and add three update sites:

From these update sites, install all the tools offered.

After Eclipse relaunched, we define a local SpringSource dm Server that will be used to deploy our 2 projects. Start with opening the Servers view in Eclipse.

The New Server wizard starts, you select SpringSource dm Server v1.0, give a name and press Next.

In the second part of the wizard, you point to your installation folder of the SpringSource dm Server. You only have to do this once. The wizard will create a SpringSource dm Server Runtime Environment, similar to the different Java Runtime Environments you can have in Eclipse.

Press Finish and your server is now listed in the Servers view.

Using the buttons at the top of the Servers view, you can start and stop the SpringSource dm Server. All output should be accessible in the Console view within Eclipse. Go ahead and try it out.

In the next article, I will start with the development of the backend and web modules. So stay tuned for more!

No comments