Running the XML Server as a Windows Service or UNIX Daemon

For a production environment it can be more effective, for purposes of ensuring availability at restart, avoiding accidental shutdowns via an open shell prompt, etc., to run the XML Server as a Windows service or UNIX daemon.

To run a program as a Windows service requires specific Windows infrastructure; that is, batch files and programs cannot be run this way out-of-the-box. However, there are third-party tools available to enable this functionality. One example of such a tool is the Java Service Wrapper from Tanuki Software (http://wrapper.tanukisoftware.com).

With Tanuki Java Service Wrapper we recommend, after installation, integrating the XML Server using the WrapperStartStopApp class (setting wrapper.java.mainclass=org.tanukisoftware.wrapper.WrapperStartStopApp) and you would need to:

Specifically, for the Java Service Wrapper the properties would look like:

wrapper.java.classpath.<n>=<ANT_HOME>/lib/ant.jar
wrapper.java.classpath.<n>=<ANT_HOME>/lib/ant-launcher.jar
wrapper.java.additional.<n>=-Dant.home=<ANT_HOME>
wrapper.java.maxmemory=768
wrapper.app.parameter.1=org.apache.tools.ant.launch.Launcher
wrapper.app.parameter.2=2
wrapper.app.parameter.3=-f
wrapper.app.parameter.4=<CURAMSDEJ>/xmlserver/xmlserver.xml
wrapper.app.parameter.5=org.apache.tools.ant.launch.Launcher
wrapper.app.parameter.6=true
wrapper.app.parameter.7=3
wrapper.app.parameter.8=-f
wrapper.app.parameter.9=<CURAMSDEJ>/xmlserver/xmlserver.xml
wrapper.app.parameter.10=stop

The values in angle brackets above would need to be substituted with the appropriate values for your local installation. See the Java Service Wrapper documentation for more details on installation, configuration and running.

Running the XML Server as a UNIX daemon is something that can typically be done with shell scripting and system facilities (e.g. cron); but, UNIX -compatible versions of Java Service Wrapper are available.