Install Genesis II as a Windows Service

In order to install a Genesis II container as a Windows Service, we must use the Java Service Wrapper.It can also be installed as a unix daemon, but this how to will focus on Windows.
The instructions for both setups will be almost identical.

There are two ways to integrate the Java Service Wrapper for use with Genesis II.
One is to use the WrapperSimpleApp class to launch the container.The other is to create a class that implements WrapperListener. It is easier to implement the first method, but will be beneficial to use the second if possible.
Only the second implementation requires any Java coding.

Part 3 contains information for my JBoss version that prepares the host computer for use with GeniiNet.

Integration by JBoss

Getting started

Install Genesis II on your system. We are assuming for this tutorial that we will install Genesis II to C:\Genesis, and JBoss will be installed within that.
Configure Genesis II as necessary, such as editing security files and configuration properties.

Follow the directions for integrating the Wrapper with JBoss. I followed these directions for Windows and got the wrapper working perfectly. For the linux version, I had an issue with using the JBoss version that they did.

Editing wrapper.conf

Next, we must customize the wrapper.conf configuration file to meet Genesis II's needs. Essentially, we will be copying the information from Genesis II's runContainer.bat into the configuration file for the Java Service Wrapper.

Here are a list of all of the properties that need to be changed or added if they do not exist by default:

wrapper.console.title=Genesis II Container
wrapper.ntservice.displayname=Genesis II
wrapper.ntservice.description=Genesis II Container

The process_priority setting is important to set on shared computers. If you want the container to be secondary to any other processes, then set it to LOW. For a full description, see its property page.

Here is the full list of configurable properties for wrapper.conf.


Once configured, you may now install Genesis II as a service. Per the Java Service Wrapper guide, it is a very good idea to test your container before actually installing a service.


Run JBoss.bat from the bin directory of your JBoss installation. If you find no error messages, you may shut it down and proceed to installing as a service.
If you do encounter an error, here are a few possible places where I have had problems:

    Installation of JBoss did not work properly. 
FIX: Run run.bat from the bin directory of your JBoss installation. It might be good to run it from the command line to catch all output.
If it starts successfully, then the problem is further down this list.
Installation of Java did not set environment variables.
FIX: It is important to note that the JAVA_HOME environment variable must be set for "\lib\tools.jar" to be acceptable.
Also, the correct version of Java must refer to the Java command. You may set this explicitly by changing the property.
For any errors that appear to occur that specifically mention anything with Genesis II, you should run runContainer.bat from within C:\Genesis
to make sure that your Genesis II installation is setup properly.

You may also check the logs directory of your JBoss installation, which may contain helpful information.

Installing the Service

Run InstallApp-NT.bat from the bin directory of your JBoss installation. You must have administrative privileges on that machine to install a service.
You will receive an error if you do not have access. You may check whether or not the installation was successful by going to Start->run and typing "services.msc".
If everything was configured properly, then you should see a new service named Genesis II.
The startup type by default is automatic, which may be changed by altering the wrapper.ntservice.starttype property. To start the service, either reboot the machine, or right click on the service and select start.


Run UninstallApp-NT.bat from the bin directory of your JBoss installation. To check whether or not the removal succeeded, run "services.msc" and make sure that there is no longer a Genesis II service listed.

Linux Notes

For use with linux installations, use the jboss program in the bin directory of your JBoss installation. You may test it by running it from the console: "./jboss console" or you may set it to run as a daemon: "./jboss start". Type "./jboss" for a list of all acceptable usages.

Integration by Coding

Instructions for this integration technique are located here. It is preferable to use this method, if possible, because it does not require a middleware application, such as JBoss.

GeniiNet Installer Package

Install zip

You may download a copy of the installer here. It is meant for use with a usb key. Running the installer bat will install a copy of Genesis II on the machine.
It will keep track of that computer's local IP address so that you can attach it to GeniiNet in the next step.

Install script

I wrote a small perl script that will take the list of ip's generated by the installer and will turn it into a Genesis II script. The output script will attach each host to GeniiNet and will set security on it.