Friday, August 12, 2005

What Time Is IT? A DBE Service

Files: UCEDateExample.zip

This is a very short tutorial of how deploy and run a simple service based onto the DBE Execution Environment (ExE). When the service is called, it returns the date of the system in which the service is running.

While the service is nothing to get excited about, it demonstrates in simple terms the steps to deploy and consume a DBE service. The tutorial is based on some of the DBE training materials used during a DBE Technology Workshop held in Helsinki (Findland).


The tutorial has 6 parts:

  • Requirements
  • Installing and configuring servENT
  • Running servENT
  • Deploying the Service
  • Running the Service
  • Conclusions

Requirements

I will assume initially that we are using a MS Windows based system (XP Pro, 2000, Server, etc) and that you have also installed on the system initially the Java Runtime Environment (JRE) or the java SDK.

First you need to install the latest version of the servENT (currently version 1.4). The servENT is a hybrid client/server. The servENT site provides a short description of what the servENT is:

“A peer2peer application container that isolates the programmer from the peer2peer coding complexity. Applications are coded as a POJO (Plain Old Java Object) object without any single acknowledge of distributed programming”

In simpler terms, the servENT allows developers to create distributed applications as if they were local applications. servENT is both a client and a server, making the design of Services Oriented Architectures and digital ecosystems based on service aggregation simpler.

You can download the version 1.4 of the servENT here(*):

http://gaudi.techideas.info/dist/

(*) Version 1.5 of the servent has been released. This tutorial assumes that you have version 1.4.

Installing and configuring servENT
To install the servENT, double click on the jar file or run it from the command line:

java –jar servent-0.1.4.jar



After running the command, a window appears prompting you to accept the GNU Lesser GPL Licence and the installer will ask you where to install servENT. For simplicity, lets assume that we install the servENT on C:\Program files\servent (The default directory of the installer, see the previous picture).

Once the servent is installed, you will need to edit and change a couple of properties in the servent.props file. This file is located under C:\Program Files\servent.

Open the file and first of all, make sure that the property “rootPath” has the format (with forward slash)

rootPath=C:/Program Files/servent

Also, uncomment the property "fada.autostart" so that it reads

…..

#fada.leaseTime=6000

#fada.lookuptime=10000

fada.autostart=true

……

Also, change the password to something different and make a note. The property is called “adminPassword”

……

adminPassword=Your password here

….

We will need this password when deploying a new service. Save the servent.props file.

Running servENT
We are almost there. Now we need to run servENT. Under the c:\Program Files\servent\bin, double click on the run.bat. You should see the servent running spitting out lots of debug/output messages. The last message should read.

FADA on ready completed

If you get errors or servENT does not work, make sure that you have modified correctly the servent.props file

The servENT is actually made of two components servENT and FADA. You can read more about the architecture on http://swallow.sourceforge.net/ and http://fada.techideas.info/

Once the servENT is running, you can point your browser to http://localhost:2002/ and you should see the node management interface:



Deploying a Service
Now we need to deploy the service. Download the UCEDateExample.zip and unzip it to your local hard disk. In my case I unzipped the file in my F:\ drive. Under that directory there is a file called deploy.html. this file will upload a service to the local servENT, which is assumed that is running on your local machine (localhost).

Our Date service is already created and packed on a .dar file (Deployment ARchive) called "deployThis.dar"


Open the deploy.html, click on the “Browse” Button and select (open) the "deployThis.dar" file. Click on "go!". The system should prompt you for the password that you entered earlier. If everything went OK you should see a “Service Registered” message/page.


Browse to http://localhost:2002/services, and you should see our service registered:



Now is time to run our service. There is a .bat file called runClient.bat, if you run that command, from a console (not by double clicking) you should get an output like this:
conclusions

Conclusions

This sort tutorial has shown how to deploy and consume a DBE service. The .zip archive also contains instructions and scripts for Windows to compile and create the .dar file (see included readme.txt).

For simplicity, it has been assumed that everything is run under the same machine. However, it is possible to install a servENT node on a different machine in your local area network and start exploring the possibilities of running Services in the P2P network rather than running (Web)Services in a typical Client/Server architecture. If you do that, the FADA node management interface has an option to use multicast broadcast for the nodes to find each other (under the your servent/fada directory, the file is called "configure.bat)".

4 Comments:

At 5:11 pm, Anonymous Anonymous said...

This comment has been removed by a blog administrator.

 
At 10:44 am, Anonymous chris said...

Hi,
The link to the DateExample seems to be broken?

Chris

 
At 2:35 pm, Blogger Víctor Bayón said...

Thanks!

I hope that it is fixed now

/Victor

 
At 6:50 pm, Anonymous Anonymous said...

The "gaudi" links do not appear to be working.

Also, getting a Connection Refused (Fada) error when modifying the servent.props file and then running the bin/run.bat file to get the servENT running.

Any ideas? Thanks. Zaf.

 

Post a Comment

<< Home