Child pages
  • Running the Server As a Service

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The Servoy Application Server comes bundles with an Java Service Wrapper, to facilitate the automatic launch of the Servoy Application Server when the server on which the Servoy Application Server is installed is started.

Supported platforms

The Java Service Wrapper supports virtually all platforms on which a Java Virtual Machine is available (also required to run the Servoy Application Server). For more info, see #More info on the Java Service Wrapper component.

On Windows it creates a Windows Service, on other platforms it utilized Unix Deamons.

Installation

The Java Service Wrapper is an optional component that needs to be checked in the Servoy All-In-One installer, see Running the All-In-One Installer (The Application Server Service option). 

When checked during the installation, an extra service directory is created in the ../application_server/ directory. This directory contains, among others, the configuration file for the service, called wrapper.conf.

Additional configuration

The configuration of the Java Service Wrapper is done through the file wrapper.conf located in ../application_server/service.  

...

Changing configuration on Windows

...

When changing the value of any any wrapper.ntservice.* property on Windows, the Service needs to be uninstalled first and reinstalled after the changes have been made.

Uninstalling the Windows Service can be done using the following command:

Code Block

wrapper -r wrapper.conf

(Re)installing the Windows Service can be done using teh following command:

Code Block

wrapper -i wrapper.conf

...

Configuring the Windows Service to automatically start on reboot of the machine 

...

By default the windows Service is configured to be started manually. This can be changed by setting the wrapper.ntservice.starttype property to AUTO_START.

...

Configuring Windows Service dependencies

...

The Java Service Wrapper does NOT start the database, as in production environments the database could be installed on a different machine or is maintained by a DBA.

If the database is running on the same machine as a service, it is possible to configure a dependency to it in the Java Service Wrapper configuration. the dependency can be set by adding the name of the service on which the Servoy Application Service depends as a the wrapper.ntservice.dependency.x property. The "x" at the end of the property name needs to be a sequential number, starting with 1, for each dependency.

...

Memory Setting

...

Running multiple Servoy Application Servers as a Service on a single machine 

...

When running multiple Servoy Application Servers as a Service on a single machine, some configuration adjustments are required to not let the different services influence eachother.

The following properties require a unique name:

  • wrapper.port (default 1777)
  • wrapper.ntservice.name (default ServoyService, Windows only)

On Windows the wrapper.ntservice.displayname and wrapper.ntservice.description could be modified to further distinguish the different windows Services from each other. Note that these two settings are just for display purposes in the Services overview in windows and do not affect the actual operation of the services.

...

Additional configurations

...

The Java Service Wrapper has extensive configuration options. The most fundamental settings have been discussed in this chapter already. In this paragraph some more advanced settings are detailed

OutOfMemory action 

Java process need to be explicitly told how much memory they are allowed to use. In case the process required more memory than it's allowed to use, based on the configuration, Java will throw OutOfMemory exceptions. When this happens, the state of the process becomes unreliable,  as some vital business logic might not have been executed. Java only has limited options to take action when OutOfMemory exceptions occur.

The Java Service Wrapper however support a monitoring feature that is capable of taking action in case OutOfMemory exceptions occur. The following snippet of configuration will perform a thread dump and then a restart of the Servoy Application Server in case of OutOfMemory Exceptions.

Code Block

wrapper.filter.trigger.1=Exception in thread "*" java.lang.OutOfMemoryError
wrapper.filter.action.1=NONE

wrapper.filter.trigger.2=Exception in thread "*" java.lang.OutOfMemoryError
wrapper.filter.allow_wildcards.2=TRUE
wrapper.filter.action.2=DUMP,RESTART
wrapper.filter.message.2=The JVM has run out of memory.

...

More info on the Java Service Wrapper component

...

The Java Service Wrapper is a bundled third party component also called [Java Service Wrapper|http://wrapper.tanukisoftware.com/doc/english/download.jsp] by [Tanuki Software|http://www.tanukisoftware.com/en/index.php] . For indepth documentation have a look [here|http://wrapper.tanukisoftware.com/doc/english/introduction.html].

The component is licensed by Servoy to be bundled and used in combination with the Servoy Application server only. It's not allowed to use the component outside the context of the Servoy Application Server.