Running the standalone server as a Windows service

Folks,

This important post is relevant for JIS customers running the standalone server as a Windows service.
I’d like to make you aware of a problem which can easily lead to a production down situation.

When deploying the server as a Windows service using the default configuration, the server will shutdown when the last user logoff the server machine. In the past we received several reports of this problem leading to a production down situation.
The reason for this problem is that when logging off from the Windows machine the Java process shutdown hook is activated by an operating system signal and this in turn causes the standalone server to shutdown.

To avoid this, you have to make sure all the server Java processes are using the -Xrs Java command line flag.

-Xrs stands for “Reduced Signal”, it will tell Java to ignore the logoff signal and continue to run after the last user logoff the server.

You need to define the -Xrs flag in two different places in your JIS runtime installation:

  1. jacadasv.bat under the bin folder.
  2. The jacadasv.ini file under the classes folder.

More specifically in the jacadasv.bat locate the Java command line and add the -Xrs flag just after the Java command before the -classpath flag. i.e. …\utils\jre\bin\java" -Xrs -classpath …
Also note that you might have to repeat this process every time you create a new runtime installation.

In the jacadasv.ini locate the setting JavaOptions in the section [VMCommandLine] and add the -Xrs just after the ‘=’ sign before any other command line flag.
If you have multiple [VMCommandLine] sections repeat this steps for each one of them.

Note that the side effect of -Xrs flag is that in certain configurations Java will not respond to a Ctrl+Break signal thus preventing the option of taking a thread dump. In our view this is a small price to pay and various workarounds for this exist.

Q: How can I tell if my server is configured correctly ?
A: There are several ways to do this depending on the product version and Windows version. If you registered the server using the JbsToService.exe utility from one of the recent product versions, you can see the the server command line in the JBSService.log file in the …\JacadaFiles\classes\logs folder. You can also see the command line for the other server processes in debug_start.log and debug_1.0.log

Another option is to start the server from the command line (not as a Windows service) and use a tool such as the Java JDK VisualVM (jvisualvm.exe) or jps.exe to view the full Java command line. Make sure the -Xrs flag exists. Other tools you can use are the Task Manager in Windows 2008 and higher or the Windows Sysintenals Process Explorer utility.

Q: If I see that my server is running without the -Xrs flag, what are the risks ?
A: The risk is that your server will shutdown once the system administrator logoff the server machine therefore we recommend to fix this problem immediately.

Q: Can you address this problem as part of the product ?
A: We are looking into creating a global fix for this problem in one of our next releases.

If there additional questions please post them in reply to this message.

Best regards,
Lior