Genii SetUp

From VCGR Wiki

Jump to: navigation, search

Contents


This page describes how to setup a PC for Genesis II development with Eclipse. This setup will enable running Genesis II builds from Eclipse. If you do not plan on using Eclipse, consult the Genesis II Development Tutorial. If you would like to run a standalone build of Genesis II, consult the Starting Up GenesisII wiki.

Note: Your username will need to be part of the gbg partition to complete this setup. Contact root@cs if you are not.

INSTALLATIONS

Java

If you do not have a version of Java 6.x, install and configure the appropriate package for your needs. Freely licensed versions of both the Java 6.x JDK are available here.

Download the Java Developer's Kit (JDK) if you plan on modifying the Genesis II source code or otherwise compiling Genesis II from source code. Once everything is installed, you should add a new system environment variable. Under the advanced tab of System Properties, go to environment variable and create a new system variable:

 Variable name: JAVA_HOME
 Variable value: <location of jdk dir> (i.e. C:\Program Files\Java\jdk1.6.0)

Eclipse

Download the newest version of Eclipse. Among providing a software development environment, you can use Eclipse for dynamic code injection while debugging (no need to restart your Jetty container), call-hierarchy searching, auto-formatting, as well as use a plugin (Subclipse) for Eclipse for SVN (with GUI features for diff’ing workspaces/files/etc.),

Note, when you first run Eclipse you will be asked to select a workspace. Be careful when you specify the workspace location. A path that contains spaces will cause problems later.

Subclipse

There is a project/plugin for Eclipse that allows you to use Subversion called Subclipse. This plugin can be downloaded from http://subclipse.tigris.org. Once downloaded, unzip the installation package into your Eclipse installation directory.

If you plan on checking code in, you will need to setup an SVN account for yourself. Contact Mark.

Genesis II

To obtain a copy of the Genesis II source, we will do an SVN checkout from the Genesis II module. Under the File menu in Eclipse, Import..->Other->Checkout Projects from SVN with the following specifications:

SELECT/CREATE LOCATION (Select an existing repository location or create a new location)

 URL:svn://camillus.cs.virginia.edu:9002/GenesisII

CHECK OUT AS (Select the method of check out and the revision to check out)
You will probably want to select the Check out as a project in the workspace option (this is where you can give this checkout a unique name) and check out the TRUNK (unless you want to get a different version of the build). At this point you can click finish unless you want to change the project location.

CHECK OUT AS (Select the project location)
Be careful what you specify the workspace location as for the project. A path that contains spaces will cause problems later.

CONFIGURATIONS

Eclipse Package Explorer

For easier browsing of the Genesis II source code, you may want to setup your Package Explorer view with the following options:

  • Right click on the package explorer menu button (down arrow) and under Package Presentation select Hierarchical.
  • Right click on the package explorer menu button (down arrow) and select Filters. Add the following selections: Libraries from external and Libraries in project.

JDK Compliance

We need to make sure the version of Java that Eclipse will be using to compile Genesis II is the correct version. You will not be able to do this until there is a project in the workspace. Under the File menu in Eclipse select Properties. Under the Java Compiler heading select Configure Workspace Settings. Set the JDK Compiler compliance level to 6.0.

Security

After the source distribution has been obtained, you must configure your JRE to allow the BouncyCastle JCE security provider to run at full strength (no restrictions on key length or algorithm selection). This is can be done by copying the Unlimited Strength Java Cryptography Extension (JCE) Policy Files (the two .jar files found in <GII-BASE>/ext/jce) to the JDK’s jre\lib\security directory.

Ant Builds

To build Genesis II, we use Ant. There are two Ant targets that are most often used: build and clean.

Note: To clean the state of the system, you will need to manually delete the hidden .genesisII directory. Refer to the next section for the location of this directory.

The build target loosely performs the following activities:

  • Creates directories for generated sources
  • Normalizes our extended form of WSDL (GWSDL) into proper service WSDL
  • Runs Axis WSDL2Java stub generation on our service WSDL to create the Java stub classes used by client tools and the data-structure classes for representing operation parameters within both client and server code.
  • Performs some housekeeping on the .wsdd service deployment descriptors so that the Axis web application can find the proper classes to invoke methods upon
  • Compiles both the generated and pre-existing sources
  • Archives the bytecode class files into their respective utility, client, and container .jar files.
  • Creates shell scripts for starting the container / command-line tools in the base GenesisII directory

To create these Ant targets select External Tools under the Run menu. Create Ant Builds with the following specifications.

Creating the Clean Ant Target

  • Name: <Build Clean>
  • Under the Main tab: browse and select the build.xml file for your Genesis II project.
  • Under the Target tab: select only clean
  • Under the JRE tab: make sure that the Separate JRK points to the version of Java we just installed. This will not be the case if there was a pre-existing JRE. Add the appropriate JRE by browsing to its location via the Installed JREs button. Also, make sure that the working directory is the workspace.

Creating the Build Ant Target

  • Name: <Build Codegen>
  • Under the Main tab: browse and select the build.xml file for your Genesis II project.
  • Under the Target tab: select only genii.ws
  • Under the JRE tab: make sure that the Separate JRK points to the version of Java we just installed. This will not be the case if there was a pre-existing JRE. Add the appropriate JRE by browsing to its location via the Installed JREs button. Also, make sure that the working directory is the workspace. Under VM Arguments add: -XX:MaxPermSize=128M.

After running these Ant targets, be sure to refresh (F5) and clean the project so that Eclipse can re-cache and fully notice the changes.

User Directory for Genesis II Grid State

When running, the GenesisII container creates and manages its database state in a .genesisII directory. Additionally, the command-line client tool(s) keep their session state (transient login credentials, current working directory, etc.) in this directory. By default this directory is located at:

  • “$HOME/.genesisII” for Linux
  • “C:\Documents and Settings\<username>\.genesisII” for Windows

The default location of this directory can changed in the Debug/Run Profile. However, if you are not using Eclipse, you can also change this location in windows by adding a new system environment variable. Under the advanced tab of System Properties, go to environment variable and create a new system variable:

 Variable name: GENII_USER_DIR
 Variable value: <location of dir> (i.e. C:\.genesisII)

Note, youl will need to manually delete this directory in order to restart your container in a totally “clean state”.

Debug/Run Profile

To run Genesis II within Eclipse, you will need to configure a debug/run profile. You can do this by right-clicking on the project (in the Package or Navigator view) and selecting the “Debug As…Debug” option. Create a new Java Application with the following specifications.

This will enable you to run the Genesis II container and client simply by selecting it from the drop-down list of the debug launcher toolbar button.

Creating a Profile for Running the Container

  • Name: <Container>
  • In the Main tab, choose the project we are running and set the Main class as: edu.virginia.vcgr.genii.container.Container
  • In the Arguments tab, add the following VM arguments:
-Dlog4j.configuration=genesisII.log4j.properties
-Djava.library.path=${workspace_loc:<project_name>\jni-lib}
-Dedu.virginia.vcgr.genii.install-base-dir=${workspace_loc:<project_name>}
-Djava.net.preferIPv4Stack=true
-Djava.net.preferIPv6Addresses=false
  • If you want to change the default location of the .genesisII directory: in the Environment tab: create a new variable called GENII_USER_DIR and set the location as you wish.

Creating a Profile for Running the Client

This will create a launch configuration that starts the CLI tool in its simple “shell” mode, allowing you to use its full complement of subtools. Selecting the shell argument saves you from having to create/edit limitless configurations for each variant of each subtool.

  • Name: <Client>
  • In the Main tab, choose the project we are running and set the Main class as: edu.virginia.vcgr.genii.client.cmd.Driver.
  • In the Arguments tab, add the following VM arguments:
-Dlog4j.configuration=genesisII.log4j.properties
-Djava.library.path=${workspace_loc:<project_name>\jni-lib}
-Dedu.virginia.vcgr.genii.install-base-dir=${workspace_loc:<project_name>}
-Djava.net.preferIPv4Stack=true
-Djava.net.preferIPv6Addresses=false
  • If you want to change the default location of the .genesisII directory: in the Environment tab: create a new variable called GENII_USER_DIR and set the location as you wish.

Database Viewer

(This is an optional feather for more advanced users.)You can query and view what's in the database that Genesis II creates without going through Genesis II. Create the following run profile. Note, you cannot have a container running and simultaneously use this tool on the database due to locking conflicts.

  • Name: <DB>
  • In the Main tab, set the Main class as org.hsqldb.util.DatabaseManagerSwing.

When you run this tool, you will want to make a profile with the following settings:

  • Type: HSQL Database Engine In-Memory
  • Driver: org.hsqldb.jdbcDriver
  • URL: jdbc:hsqldb:file:<User Directory Path>\database

RUNNING GENESIS II

Once you have setup the above, here are the steps to running Genesis II.

  1. Run the ant build profile.
  2. Run the container run profile.
  3. Run the client run profile.

At this point you should see the Grid shell running and ready for input commands.

Sarnowska 11:43, 18 February 2009 (EST)