WSO2 SOA Enablement Server for Java 6.6 can be run as a service on Windows 2000/XP. Support for NT service installation is installed by default on Windows servers, and cannot be installed on UNIX machines. The support is a set of executable files that let you install, start, stop, and uninstall WSO2 SOA Enablement Server for Java as an NT service.
The server log is by default written into the log file. The output to the NT log can be manually configured.
To run WSO2 SOA Enablement Server as an NT service, the WSO2 SOA Enablement Server installation must contain the component Support for NT Service Installation. This component is installed by default with the server. Please read Stand-alone Installation in the Installation Guide if you have not yet installed WSO2 SOA Enablement Server for Java 6.6.
![]() | Note |
---|---|
You cannot run WSO2 SOA Enablement Server ported to an application server as an NT service by default. For more information, see the Customizing section. |
When the WSO2 SOA Enablement Server for Java installation is complete, the WASP_HOME\bin directory contains these four batch files related to NT service support:
InstallService.bat
UnInstallService.bat
StartService.bat
StopService.bat
If these files are not present in your installation, you have not installed the NT service support component.
![]() | Note |
---|---|
After installing WSO2 SOA Enablement Server for Java with NT Service support, the WSO2 SOA Enablement Server is NOT installed as an NT service. It must be installed manually, as described in the following steps. |
If you want to customize the NT service first (set-up the JVM max memory, add files to classpath, etc.), please read the Customizing section now.
Make sure that the JAVA_HOME environment variable points to your JDK and run the InstallService.bat command.
When the installation is finished, the name of the installed NT service is printed to the screen. The default name is WSO2 SOA Enablement Server for Java.
![]() | Note |
---|---|
You may need extra permissions to install a new service into your OS. To determine whether you have these permissions, please consult your system administrator. |
If the installation fails, read the Customizing section. If it does not contain the solution, contact http://support.wso2.com/.
Once the WSO2 SOA Enablement Server NT service is installed, start it like any NT service, using the Windows tools and commands: Control Panel Administration tools Services, and select net start.
As a shortcut, you can use the StartService.bat command in the WASP_HOME\bin directory.
![]() | Note |
---|---|
You may need extra permissions to start or stop an NT service in your OS. To determine whether you have these permissions, please consult your system administrator. |
To stop the server, use either the system tools or the StopService.bat command.
![]() | Note |
---|---|
For security reasons, you cannot use serverstop.bat or server.bat stop to stop a WSO2 SOA Enablement Server that is running as an NT service. |
By default, the logs of the server are written into the WASP_HOME\log\wasp_NTService.log file. The default maximum size of the log file is 1MB. When the file is full, a backup is created and the content of the file is cleaned. By default, 3 backups are kept and older backups are deleted.
WSO2 SOA Enablement Server for Java uses the Log4J library for logging. You can manually change its logging behavior. The configuration is stored in the file WASP_HOME\conf\log4j_NTservice.config. You can change the log output, message priority and other settings in this file as follows:
To change the message priority from INFO to ERROR, change the settings of the active category in the config file from log4j.rootCategory=INFO,R to log4j.rootCategory=ERROR,R
To change the log file properties, change the Rolling File appender settings:
log4j.appender.R.File=log/wasp_NTService.log log4j.appender.R.MaxFileSize=1024KB log4j.appender.R.MaxBackupIndex=3
To switch logging from file to NT log, comment out the line log4j.rootCategory=INFO,R and uncomment the line #log4j.rootCategory=ERROR,ntlog from this section:
# Assigning appenders to categories # (using rolling file appender by default) log4j.rootCategory=INFO,R # Uncomment next line if you want to use NT Event Log # to log error messages. #log4j.rootCategory=ERROR,ntlog
so that the section reads:
# Assigning appenders to categories # (using rolling file appender by default) #log4j.rootCategory=INFO,R # Uncomment next line if you want to use NT Event Log # to log error messages. log4j.rootCategory=ERROR,ntlog
![]() | Note |
---|---|
We recommend that you log only errors into the NT log. |
Rolling File and NTLog are the two default appenders. You can choose any log4j appender that suits your needs. To add custom classes to WSO2 SOA Enablement Server NT service classpath, see the Customizing section.
You must restart the WSO2 SOA Enablement Server service to put the changes into effect.
For more information about log4j and its settings, please visit Apache/Jakarta's Logging Services pages.
You can manually set up the name "WSO2 SOA Enablement Server's NT Service" and the JVM parameters that are used to start WSO2 SOA Enablement Server as an NT service. To customize logging, please visit the previous section, Logging.
All customizable files in the following instructions are located in the WASP_HOME\bin directory.
![]() | Important |
---|---|
All the following changes require reinstallation of WSO2 SOA Enablement Server's NT Service. Uninstall it first, make your modifications and reinstall the service. |
The default name of the NT service is WSO2 SOA Enablement Server for Java. To change the service name:
Uninstall the existing service by running UnInstallService.bat.
In each of the files below, change the system variable NT_SERVICE_NAME, so the row with the variable reads:
set NT_SERVICE_NAME=new_name
The files to be edited are:
UnInstallService.bat
InstallService.bat
StartService.bat
StopService.bat
Install your NT service with its new name by running InstallService.bat.
Start the new service by running StartService.bat.
The parameters of the Java Virtual Machine are set up during the installation of the NT service. If you modify the parameters, you must reinstall the NT service to put the changes into effect. To modify the parameters of the NT service, open InstallService.bat in a text editor and do the following:
To change the maximum size of available memory, change the value of the JVM_MEM variable, with a command like set JVM_MEM=-Xmx256m.
To add custom files to the classpath, edit the WaspService.exe parameters. These are in the line "-Djava.class.path=%WASP_HOME%\lib\wasp.jar".
WSO2 SOA Enablement Server does not support installation of ported WSO2 SOA Enablement Server as an NT Service. For more information, please see the documentation of your application server provider. However, any Java application can be installed as an NT Service with the NT service solution of WSO2 SOA Enablement Server.
To uninstall the WSO2 SOA Enablement Server NT service, run UnInstallService.bat from the WASP_HOME\bin directory. The uninstaller first tries to stop the NT service. It then removes the NT service from your OS.