Windows Service For TCP Locator

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 :-

  1. Download YAJSW from http://sourceforge.net/projects/yajsw/files/.
  2. Unpack the zip file to a folder <yajsw>.
  3. Do not remove or copy files from this folder to any another folder. Do not rename any folders within <yajsw>.
  4. Call java -version and ensure that your default java installation is 1.5 or higher.
  5. Start TCP Locator using startlocator.bat script.
  6. 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.
  7. Go to yajsw/bat and execute genConfig.bat <pid>.
  8. This generates the file yajsw/conf/wrapper.conf which is the configuration file for wrapping TCP Locator.
  9. Stop TCP Locator.
  10. 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
  11. Go to yajsw/bat and execute installService.bat to install the Windows service for TCP Locator.
  12. To uninstall the Windows service execute uninstallService.bat.

Verification:

To verify Windows service creation, perform the following steps:

  1. Go to Windows Service Console.
  2. The service, ‘TCP Locator Service For LiveCycle’, is listed in the services list.
  3. Start the Windows service and check GFLocator.log in TCP Locator installation folder. The TCP Locator is started successfully.
  4. 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.

VN:F [1.9.22_1171]
Was this helpful? Please rate the content.
Rating: 7.0/10 (3 votes cast)
Windows Service For TCP Locator, 7.0 out of 10 based on 3 ratings

About Pankaj Parashar

Pankaj Parashar is a Lead Software Engineer at Adobe Systems. He is working for Adobe LiveCycle Enterprise Suite. He looks after cluster deployments and LiveCycle SDK testing. His interests include programming, cloud, big data and analytics. He is based out of Noida, India.
This entry was posted in Adobe LiveCycle ES3. Bookmark the permalink.

4 Responses to Windows Service For TCP Locator

  1. JBNC12 says:

    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

    • Pankaj Parashar says:

      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.

  2. Steve Fletcher says:

    I’m having problems getting this to work on my Websphere 7 cluster. The TCP Locators work fine but I’m unable to get the service to start. I also can’t get this running with runConsole.bat.

    I’ve set up the TCP Locators to use the Websphere java executable. I’ve also modified setenv.bat to do the same:
    rem default java exe for running the wrapper
    rem note this is not the java exe for running the application. the exe for running the application is defined in the wrapper configuration file
    set java_exe=”D:\WebSphere\AppServer\java\bin\java”
    set javaw_exe=”D:\WebSphere\AppServer\java\bin\javaw”

    Thanks,

    Steve Fletcher

    • Pankaj Parashar says:

      Hi Steve,

      Could you please share wrapper.conf file generated for TCP Locator java process?

      Is there any kind of error message you see?

      Thanks,
      Pankaj Parashar