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.name=TCPLocatorServiceForLiveCycle
- 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.
Verification:
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.
Windows Service For TCP Locator,
I am trying to set this up on a ES2 Jboss installation and am running into an error when starting the service.
The wrapper.log is showing a ClassNotFoundException. In the wrapper.conf file I have the following:
********************************************************************
# Application main class or native executable
# One of the following properties MUST be defined
# Java Application main class
wrapper.java.app.mainclass=-Dgemfire.license-type=production
********************************************************************
I am running Java version 1.6014
WARNING|wrapper|yajsw|12-10-25 09:04:14|YAJSW: yajsw-stable-11.03
WARNING|wrapper|yajsw|12-10-25 09:04:14|OS : Windows Server 2008/6.0/amd64
WARNING|wrapper|yajsw|12-10-25 09:04:14|JVM : Sun Microsystems Inc./1.6.0_14
INFO|wrapper|yajsw|12-10-25 09:04:14|ahessian jmx service bound to port 15002
INFO|wrapper|yajsw|12-10-25 09:04:15|spawned system tray icon process with pid 500
INFO|wrapper|yajsw|12-10-25 09:04:15|set state IDLE->STARTING
INFO|wrapper|yajsw|12-10-25 09:04:15|Controller State: UNKNOWN -> WAITING
INFO|wrapper|yajsw|12-10-25 09:04:15|working dir D:\APPS\Adobe_LiveCycle\lib\caching
INFO|wrapper|yajsw|12-10-25 09:04:15|create script: scripts/trayMessage.gv
INFO|wrapper|yajsw|12-10-25 09:04:16|found script scripts/trayMessage.gv
INFO|wrapper|yajsw|12-10-25 09:04:16|started process with pid 8284
INFO|wrapper|yajsw|12-10-25 09:04:16|set state STARTING->RUNNING
WARNING|wrapper|yajsw|12-10-25 09:04:17|[id: 0x26c59ad5, /127.0.0.1:58316 => /127.0.0.1:15002] connected
INFO|8284/0|yajsw|12-10-25 09:04:17|[INFO] StandardFileSystemManager – Using “C:\Users\jxb930\AppData\Local\Temp\vfs_cache” as temporary files store.
INFO|8284/0|yajsw|12-10-25 09:04:18|platform null
INFO|8284/0|yajsw|12-10-25 09:04:18|error finding main method in class: -Dgemfire.license-type=production : -Dgemfire.license-type=productionINFO|8284/0|yajsw|12-10-25 09:04:18|no java main method found -> aborting
INFO|8284/0|yajsw|12-10-25 09:04:18|java.lang.ClassNotFoundException: -Dgemfire.license-type=production
INFO|wrapper|yajsw|12-10-25 09:04:18|Trigger found: Exception in line:
INFO|wrapper|yajsw|12-10-25 09:04:18|java.lang.ClassNotFoundException: -Dgemfire.license-type=production
INFO|wrapper|yajsw|12-10-25 09:04:18|start script scripts/trayMessage.gv
Ideally the configuration generated in wrapper.conf file should have the following entry.
wrapper.java.app.mainclass=com.gemstone.gemfire.internal.DistributionLocator
Please change it in your configuration file and re-install the service.