In most Windows server environments, users want software running as Windows services that are configured to auto-start and auto-stop on Windows start and stop. So far the LiveCycle provided TCP Locator is started using startlocator.bat script on the Windows environment. There is no inbuilt mechanism to start TCP Locator as a Windows service. However, there are various free tools available for creating Windows service for Java Applications. YAJSW (Yet Another Java Service Wrapper) is one such tool that wraps a Java process and runs it as a Windows service. YAJSW is an LGPL licensed tool.
The following steps will take you through the creation of a Windows service for TCP Locator using YAJSW :-
- Download YAJSW from http://sourceforge.net/projects/yajsw/files/.
- Unpack the zip file to a folder <yajsw>.
- Do not remove or copy files from this folder to any another folder. Do not rename any folders within <yajsw>.
- Call java -version and ensure that your default java installation is 1.5 or higher.
- Start TCP Locator using startlocator.bat script.
- Check the process id of the TCP Locator Java process. We need the pid of the Java process not of the batch file which started TCP Locator.
- Go to yajsw/bat and execute genConfig.bat <pid>.
- This generates the file yajsw/conf/wrapper.conf which is the configuration file for wrapping TCP Locator.
- Stop TCP Locator.
- Open conf/wrapper.conf with a text editor and make the following changes.
- wrapper.ntservice.displayname=TCP Locator Service For LiveCycle
- wrapper.ntservice.description=Starts TCP Locator
- Go to yajsw/bat and execute installService.bat to install the Windows service for TCP Locator.
- To uninstall the Windows service execute uninstallService.bat.
To verify Windows service creation, perform the following steps:
- Go to Windows Service Console.
- The service, ‘TCP Locator Service For LiveCycle’, is listed in the services list.
- Start the Windows service and check GFLocator.log in TCP Locator installation folder. The TCP Locator is started successfully.
- Now stop the service and check GFLocator.log again. The TCP Locator is stopped successfully.
Note: Two java.exe processes are launched while running TCP Locator using Windows service. In future, if you need to pass any additional jvm arguments to TCP Locator, you should create the Windows service again after passing the additional jvm arguments in startlocator.bat script.