This document describes the procedures necessary to run JOnAS as a system service on Microsoft Windows platforms.
The procedure uses the Tanuki Java Service Wrapper open source project which must be downloaded and installed separately.
Download Apache ANT version 1.7.1 or later.
Unzip the package to a directory in the local filesystem.
Set ANT_HOME
environment variable to the root
directory for Apache ANT.
For example, if the package for ANT version 1.7.1 is unzipped
into C:\Program Files
, then set ANT_HOME =
C:\Program Files\apache-ant-1.7.1
Add %ANT_HOME%\bin
to your PATH
environment variable.
Download Tanuki Java Service Wrapper version 3.3.9 or later (the "Community Edition" is sufficient for executing JOnAS as a Windows Service).
Unzip the package to a directory in the local filesystem.
Set WRAPPER_HOME
environment variable to the
root directory for Java Service Wrapper.
For example, if the package for Wrapper version 3.3.9 is
unzipped into C:\Program Files
, then set
WRAPPER_HOME = C:\Program
Files\wrapper-windows-x86-32-3.3.9
Before JOnAS can be run as a Windows service, it is necessary to create a Java Service Wrapper configuration file. Prior to executing the steps in this section, it is necessary to create a JONAS_BASE directory as described in the JOnAS Configuration Guide .
Verify that JAVA_HOME is set as a system environment variable.
Verify that JONAS_ROOT, JONAS_BASE and WRAPPER_HOME environment variables are set.
Set %JONAS_ROOT%\templates\windows_service as the current directory.
Set environment variables required for JOnAS execution (see list below).
Execute ant
[-Djonas.name=<server_name>]
Note | |
---|---|
The |
Once this is done, the wrapper.conf
file inside your
JONAS_BASE will be filled with all launch options required by
JOnAS.
Note | |
---|---|
Do not change the |
To add options to your JOnAS server running as a Windows service,
modify the wrapper_extra.conf
file in JONAS_BASE.
Note | |
---|---|
Once this file is changed, you'll need to restart the JOnAS service to see the effects. You do not need to reinstall the service, thought. |
After the %JONAS_BASE% directory has been updated for use with Java Service Wrapper, the Windows service configuration can be tested by executing the command:
jonas ntservice console
Once you see that JOnAS is running, simply press CTRL + C to stop it.
Once you're assured the Windows service is operational, install in onto Windows using the following command:
jonas ntservice install
To start the JOnAS Windows service, you can use the Windows Services control panel item or launch the following command:
jonas ntservice start
Note | |
---|---|
By default, JOnAS will be started automatically each time Windows is started. After installing the service, it can be started manually to avoid the need to reboot Windows. |
To stop the JOnAS Windows service, you can use the Windows Services control panel item or launch the following command:
jonas ntservice stop
To restart the JOnAS Windows service, you can use the Windows Services control panel item or launch the following command:
jonas ntservice restart
To uninstall the JOnAS Windows service, use the following command:
jonas ntservice uninstall
Note | |
---|---|
Do not re-create the JOnAS Windows service before uninstalling it; else JOnAS might lose the reference to the Windows service entry and therefore never manage to uninstall the service. |