Child pages
  • Running the Server As a Service
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 13 Next »

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 or rebooted.

Supported platforms

The Java Service Wrapper in combination with the Servoy Application Server is currently only supported on the Windows platform.

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.

After installation through the All-In-One installer, on the Windows platform 

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:

wrapper -r wrapper.conf

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

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

When the Servoy Application server is started as a Service through the Java Service Wrapper, the assignment of memory goes through the configuration of the wrapper in wrapper.conf, instead of through servoy_server.bat/server_server.sh.

Below the mapping for the three relevant memory settings and their equivalent in the wrapper.conf:

  • Initial Java Heap Size > wrapper.java.initmemory=...
  • Maximum Java Heap Size > wrapper.java.maxmemory=...
  • Maximum Java Perm Size > wrapper.java.additional.3=-XX:MaxPermSize=...

For more information on the the meaning of these settings and their suggested values, see Memory Management.

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 property requires a unique value:

  • 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.

The wrapper.port value does not have to be unique, because the Java Service Wrapper automatically looks for a free port if the specified port is already taken.

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.

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 Standard by Tanuki Software. For indepth documentation have a look here.

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.

  • No labels