Using Subversion with the WaterkenTM server under Eclipse

Introduction

This tutorial explains how to build a new Eclipse workspace for the Waterken server with the server code integrated with the Subversion source control system.

The Waterken server uses the Joe-E verifier to ensure that it uses authority in a way that minimizes the risk of breach. This tutorial does not include how to install the Joe-E verifier plugin and to use it to examine your own code for dangerous uses of authority. It does cover installation of the Joe-E files because the Waterken server uses some Joe-E libraries internally.

Step by step

Start new workspace for Waterken under Eclipse

Start Eclipse. Go to "File/Switch Workspace/Other". You may want to check "Copy Settings/WorkBench Layout" if you have a custom layout you like.

Eclipse will restart with an empty workspace. Click the right-most icon to go to the workspace view.

Configure proxy

If you are working behind a firewall, you may need to configure the HTTP proxy in Eclipse. In Eclipse 3.2, go to "Window/Preferences/Install_Update" and configure the proxy hostname and port. Under Eclipse 3.3, go to "Window/Preferences/General/Network Connection".

Reboot Eclipse if you had to set a proxy.

Install Subversion plugin into Eclipse

The Subclipse development team has an excellent step by step description of installing their plugin at their site.

  1. Click "Help/software Updates/Find and Install.../Search" for new features to install. Click "Next".
  2. Click "New Remote Site". In the dialog, use name "Subclipse", URL <http://subclipse.tigris.org/update_1.2.x>
  3. Select the Subclipse plugin and its subcomponents (you do not need the Integrations subcomponent).
  4. Click ok to the rest of the stuff: the license agreement, the "Finish", the "Go Ahead Even though Nobody Put a Silly Signature on the Code" button.
  5. Reboot Eclipse.

Yet another proxy setting

Subversion has its own place to look for proxy settings. Now that you have installed the plugin, the subversion software itself has been automagically installed. It needs its proxy settings configured as well. Find the "servers" file, in Windows XP it can be found in your Application Data\Subversion folder. In Windows Vista, it's at C:\users\username\AppData\Roaming\Subversion. In Linux, it can be found in ~/.subversion.

In the servers file, go to the [global] section. Find the two lines (they show up in other sections as well, do not set the wrong ones!),

# http-proxy-host = proxy2.some-domain-name.com
# http-proxy-port = 9000

Remove the # at the beginning of the line, and put in the proxy info.

Enter the Waterken repository

  1. Go to "Window/Open Perspective/ Other/ SVN Repository"
  2. Right-click in the "SVN Repos" tab, click "New", enter the Waterken server repository: <https://waterken.svn.sourceforge.net/svnroot/waterken/server/trunk/waterken>. Click "Next".
  3. Disregard the certificate warning, (i.e., click "ok, accept permanently").

Build the development environment

  1. In the Subversion tab you should now have the waterken repository listed. This brings you to all the individual project folders.
  2. For each folder, right-click and choose "Checkout.../Checkout as a project in the Workspace/Finish". Check them out in the following order (the order is not important unless you try to do test-compiles during the checkout process, the order is the order of compiler dependencies):
    1. joe-e
    2. ref_send
    3. network
    4. log
    5. persistence
    6. syntax
    7. remote
    8. shared
    9. example
    10. config
    11. dns
    12. genkey
  3. At this point, you should have all the sources for the Waterken server installed. Switch from the Repository view to the Java view, and run "Project/Clean..." to ensure it all builds.

Updating from the repository

To update, in the Java view, select the folders you want to sync/update, right-click, choose "Team/Update". This makes all the setup effort worth it, right?

Running the Waterken server

To run the server under Eclipse, you need to configure the Run or Debug window. Click "Debug/Open Debug Window... Debug as a Java Application", "Name" is "serve", "Main Project" is "remote", "Main Class" is "org.waterken.server.Serve". Go to the "Arguments" tab, set "Working Directory" to "Other", click "Variables", choose "workspace_loc". Press "Debug". You should see server messages appearing in the Console. Open a browser on <http://localhost:8080/> to see the welcome message from the server.

Build the command line interface

  1. Go into the remote folder and find the files jars.sh and jars.bat. Run the one appropriate for your operating system. This will put spawn.jar and serve.jar in the main folder: spawn.jar is used to create a new database, and serve.jar allows you to run the server without running eclipse.

  2. For non-local applications (and why would you want only-local applications?), you will need to produce a public/private key pair. In the genkey folder you will find another pair of files jar.sh and jar.bat. Run the appropriate one. In the main folder you will now have genkey.jar. Use this to generate a keypair for the server. If you are behind a firewall, you may need to configure the proxy settings so genkey can get out, if so the command line will look something like this:

    java -DproxyHost=web-proxy.hpl.hp.com -DproxyPort=8088 -DproxySet=true -jar genkey.jar

Congratulations! You are now on your own.