This article will show you how to configure Apache Geronimo v1.1 to run as a MS Windows service. A Java Service Wrapper (JSW) will be required as an additional software to achieve this configuration. Using a JSW gives you some additional "control" on the service you are configuring such as the ability to ping the service and take action if the service is down.
In this article we will review the different configuration parameters of the JSW that controls the behavior of the service and the wrapper itself.
Software prerequisites
To set up Apache Geronimo v1.1 to run as a MS Windows service you will certainly need a Java Service Wrapper. For this example we used Java Service Wrapper 3.2.0 available for download at the following URL:
http://sourceforge.net/projects/wrapper/
For this example we are also using Apache Geronimo v1.1 running on Windows XP. You can download Apache Geronimo binaries from the following URL:
http://geronimo.apache.org/downloads.html
Installing Apache Geronimo
The installation of Geronimo from the binaries is very simple. Just extract the zip file to a directory of your convenience, throughout the rest of the article this directory will be referred to as <geronimo_home>.
Installing the Java Service Wrapper
Installing the wrapper is as simple as installing Apache Geronimo. Once you downloaded the right version for your environment you can extract the zip file to a directory of your convenience, throughout the rest of the article this directory will be referred to as <jsw_home>.
Configuring the wrapper
The Java Service Wrapper comes with a sample configuration file wrapper.conf pre-configured to run a test script also provided. In this section we provide a Geronimo specific wrapper.conf file for your convenience.
The wrapper configuration file is located in the <jsw_home>\conf directory. Backup the original file and create a new wrapper.conf file with the content from the following example.
Do a search and replace all, look for the <java_home>, <geronimo_home> and <jsw_home> wildcards and replace them to match your environment.
Let's do a high level review what this configuration file does:
- At the beginning of this configuration you set the path for the JAVA executable as well as the JAVA classpath to the Geronimo jars.
- Then you specify the initial and maximum heap size for the JVM and pass along some startup related values such as user and password to start the service.
- Next you provide the logging settings, this configuration file will create a log for the install, start, stop and uninstall of this Geronimo service in the <geronimo_home>\var\log directory.
- Last but not least you give the service a name and set the start type.
Adding the service
Also provided with the wrapper are two scripts to install and uninstall the service. Since we are using the same wrapper configuration file name wrapper.conf there is no need to change any of the provided scripts.
To add Apache Geronimo as a MS Windows service run the following command:
<jsw_home>\bin\InstallTestWrapper-NT.bat
To remove the Apache Geronimo service run the following command:
<jsw_home>\bin\UninstallTestWrapper-NT.bat
Remember that for simplicity we are reusing the scripts already provided by the Java Service Wrapper installation, the script names are not relevant as both point to the wrapper configuration file we modified.
You can check the installation results in the <geronimo_home>\var\log\jsw.log file. You should see something similar to this:
Running the Apache Geronimo v1.1 service
To run the service you can use the MS Windows GUI interface or you can just use the command line option. For this working example the option of choice is the command line.
From a Windows command line run the command:
net start Geronimo
You should see a confirmation message similar to this:
Note that Apache Geronimo may take a few moments to start even when you receive the message that the service has successfully started Geronimo may still be loading.
Check the <geronimo_home>\var\log\jsw.log to see if Geronimo is fully started, the last line in your log should be similar to this:
Alternatively, if you have installed a tail command in Windows you could run the following command to monitor the status.
tail -f <geronimo_home>\var\log\jsw.log
Once you see in the log the Geronimo Application Server started message you are all set to go. You can open a Web broser and access the Geronimo Administration Console by pointing it to the following URL: