World Map
Java Service Wrapper is the easiest way to make your product more reliable.
  • Free Trial
  • Buy Now
Configuration File Directives

Overview: Configuration File Directives

As the Java Service Wrapper parses its configuration file, in most cases, it will ignore all text that comes after a '#' character as a comment. There are a small set of exceptions to this rule however.

The Wrapper historically followed the C language pattern of defining special directives which are processed as the configuration file is loaded.

Configuration File Encoding

Starting with Wrapper version 3.5.0, it became possible to specify the encoding of individual configuration files. The most portable encoding is UTF-8, but other encodings are supported on some platforms.

The encoding directive must be specified on the first line of a configuration file. The Wrapper will log a warning if any file is missing the directive. It is possible to specify different encodings in include files (cascading style)

UTF-8 Example:
#encoding=UTF-8

wrapper.debug=FALSE
...

Include Cascading Configuration File

It is possible to split a configuration in one or more optional configuration files and then include them from the main file. See the Cascading Configuration File ("include file") page for more information.

Example:
#include ../conf/wrapper-settings.conf

By design, the Wrapper will silently skip over any include files that it is unable to locate or read for any reason. This can be very powerful as it makes it possible to create platform specific configurations or optionally override existing property values.

In some cases however, an include file is required for propper operation of an application. Starting with Wrapper version 3.5.5, it is possible to specify a required include, which will cause an error and prevent the Wrapper from starting if it is missing.

Example:
#include.required ../conf/wrapper-settings.conf

Debug Include Files

Starting with Wrapper version 3.3.0, it is possible to debug the way the #include directive works by seeing exactly what is and isn't being included. See the Debug Messages in the "include file" (cascading style) page for more information.

Example:
#include.debug

Debug Properties

NOTE

These warnings are intentionally not logged by default because it is common practice to overwrite property values using optional Cascading Configuration File ("include file"), or other methods.

Starting with Wrapper version 3.5.4, it is possible to debug the loading of properties. This directive will cause the Wrapper to output a message on startup whenever any property is overwritten by another declaration, or when a property can not be set because its value is fixed.

Example:
#properties.debug

Overlaped Properties:

The Wrapper is setup so that the last defined instance of a specific property will be used. This can be very powerful as default values can be setup and then reference an option include file which could contain values specific to a system. Setting this directive can be useful to help see why a property has the value that it does.

Property Redefinition Example:
STATUS | wrapper  | The "foo.bar" property was redefined on line #8 of configuration file: /home/wrapper/conf/wrapper.conf
STATUS | wrapper  |   Old Value foo.bar=123
STATUS | wrapper  |   New Value foo.bar=XYZ

Command line:

Property values specified on the Wrapper command line are 'final', meaning that they can not be changed or overwritten by values in the configuration file. This is very useful because a user can run the Wrapper with a test value without having to actually edit the configuration file.

Final Property Redefinition Example:
STATUS | wrapper  | The "foo.bar" property was defined on the Wrapper command line and can not be overwritten.
STATUS | wrapper  |   Ignoring redefinition on line #8 of configuration file: /home/wrapper/conf/wrapper.conf
STATUS | wrapper  |   Fixed Value foo.bar=123
STATUS | wrapper  |   Ignored Value foo.bar=XYZ

Internal Environment Variables:

The Wrapper also sets several internal environment variables. These are done using final properties. If the user configuration file attempts to set any of these, then the Wrapper will ignore them and maintain the values set by the Wrapper.

Final Property Redefinition Example:
STATUS | wrapper  | The "set.WRAPPER_ARCH" property is defined by the Wrapper internally and can not be overwritten.
STATUS | wrapper  |   Ignoring redefinition on line #10 of configuration file: /home/wrapper/conf/wrapper.conf
STATUS | wrapper  |   Fixed Value set.WRAPPER_ARCH=x86
STATUS | wrapper  |   Ignored Value set.WRAPPER_ARCH=special