Index

wrapper.app.parameter.<n>

Compatibility :1.0.0
Editions :Professional EditionStandard EditionCommunity Edition
Platforms :WindowsMac OSXLinuxIBM AIXFreeBSDHP-UXSolarisIBM z/Linux

These properties are used to specify the parameters that will be passed to your application's main method.

When the value of the wrapper.java.mainclass property is org.tanukisoftware.wrapper.WrapperSimpleApp, the first parameter to the application must be the name of the class that contains your main method. All other parameters are then passed to your application's main method in order. Please see the Integration section for more details.

<n> component:

Each element has a property name that starts with wrapper.app.parameter. and the "<n>" component of the property name is an integer number counting up from "1". By default, there can be no missing numbers. The wrapper.ignore_sequence_gaps property can optionally be set to allow gaps in the sequence.

Quotes:

For each entry, you can also have a corresponding strip quotes flag (stripquotes property = TRUE), which will remove unescaped quotes from the element when run on Linux/UNIX machines. This is necessary to allow for file references that contain spaces. For parameters like the one below, it would not otherwise be possible to decide when to remove quotes and when to leave them alone. All other characters except for the following will remain unchanged.

  • '\\' will become '\',
  • '\"' will become '"'
  • '"' will become ''
Example:
wrapper.java.mainclass=org.tanukisoftware.wrapper.WrapperSimpleApp
wrapper.app.parameter.1=com.widgetsrus.MyAppMain
wrapper.app.parameter.2=-d
wrapper.app.parameter.3=-c"../conf/myapp.conf"
wrapper.app.parameter.3.stripquotes=TRUE
wrapper.app.parameter.4=-p4

NOTE

Individual parameter entry:

Application parameters are designed to be individual parameter entry. If you specify a parameter like '-c conf/myconffile.conf', it will work correctly on Windows because the '-c' and 'conf/myconffile.conf' parameters will be correctly parsed when Java is launched. But on UNIX systems, the parameters will incorrectly be interpreted as a single parameter '-c conf/myconffile.conf'.

Incorrect:
wrapper.app.parameter.1=-c conf/myconffile.conf
Correct:
wrapper.app.parameter.1=-c
wrapper.app.parameter.2=conf/myconffile.conf

wrapper.app.parameter.<n>.stripquotes

Compatibility :3.5.17
Editions :Professional EditionStandard EditionCommunity Edition
Platforms :Windows (Not Supported)Mac OSXLinuxIBM AIXFreeBSDHP-UXSolarisIBM z/Linux

If a wrapper.app.parameter.<n> value contains quotes, then the contents of the quotes will be passed to the Java Application as a single argument on Windows. However on UNIX, the quotes will also be included as part of the argument value. In most cases, this is not correct behavior on UNIX, but it is this way to maintain backwards compatibility.

The wrapper.app.parameter.<n>.stripquotes property makes it possible to tell the Wrapper to automatically strip those extra quotes on UNIX. The property is ignored on Windows.

Defaults to the value of the wrapper.app.parameter.default.stripquotes property, which itself defaults to "FALSE".

The following replacements will be made when stripping quotes. All other characters will remain unchanged.

  • '\\' will become '\',
  • '\"' will become '"'
  • '"' will become ''
Example:
wrapper.app.parameter.1="parm1"
wrapper.app.parameter.1.stripquotes=TRUE
wrapper.app.parameter.2=parm=\"value\"
wrapper.app.parameter.2.stripquotes=TRUE

wrapper.app.parameter.default.stripquotes

Compatibility :3.5.17
Editions :Professional EditionStandard EditionCommunity Edition
Platforms :Windows (Not Supported)Mac OSXLinuxIBM AIXFreeBSDHP-UXSolarisIBM z/Linux

Makes it possible to change the default strip quotes behavior on UNIX when you wish to have the same behavior for all wrapper.app.parameter.<n> property values. The default value is "FALSE". The property is ignored on Windows.

Example:
wrapper.app.parameter.default.stripquotes=FALSE

wrapper.app.parameter_file

Compatibility :3.5.17
Editions :Professional EditionStandard EditionCommunity Edition
Platforms :WindowsMac OSXLinuxIBM AIXFreeBSDHP-UXSolarisIBM z/Linux

In certain cases, it can be inconvenient to list up your application parameters in the Wrapper configuration file. This property provides a way to specify a file that can contain one or more parameters that will be passed as is to the JVM when it is launched. This can be very useful when the parameter list needs to be generated dynamically or via an installer.

Any parameters defined in this file will appear after those defined using the standard wrapper.app.parameter.<n> properties.

Starting with Wrapper version 3.5.23, any environment variable references in the file will be expanded.

Parameter File Format:

The file format is simple.

  • It must start with an encoding directive line just like the Wrapper configuration file. This is needed to tell the Wrapper what encoding to use when reading the file. If this line is missing, then the Wrapper will attempt to proceed after logging a warning. The encoding used in the file may be different from the encoding used in other configuration files.
  • Multiple parameters can be written in one line by separating each parameter with one or more spaces.
  • It is also possible to break the parameters into multiple lines.
  • The '#' character is interpreted as a comment character. To include a '#' character in a property value, the value must either be quoted ("#") or escaped by a second '#' character.
  • If any of the values need to include a space, then it is necessary to add quotes following the rules described below to make sure the file works consistently across all platforms.
Example of Parameter File UTF-8:
#encoding=UTF-8
# Example parameters: Multiple parameters in one line
-DTEST1=Value1 -DTEST2=Value2

# More parameters
-DTEST3=Value3

wrapper.app.parameter_file.required

Compatibility :3.5.36
Editions :Professional EditionStandard EditionCommunity Edition
Platforms :WindowsMac OSXLinuxIBM AIXFreeBSDHP-UXSolarisIBM z/Linux

Specifies if the parameter file is required or not. If it is required and not found, the Wrapper will stop without starting the JVM. If it is not required, the file will be ignored when not found.

The default value is TRUE.

Example:
wrapper.app.parameter_file.required=FALSE

wrapper.app.parameter_file.stripquotes

Compatibility :3.5.17
Editions :Professional EditionStandard EditionCommunity Edition
Platforms :Windows (Not Supported)Mac OSXLinuxIBM AIXFreeBSDHP-UXSolarisIBM z/Linux

Different platforms handle parameters with spaces differently. To make a given configuration work consistently, you should always quote those values. They will be used as is on Windows. However, on UNIX platforms, the quotes will be stripped as the command line is broken into a parameter list.

In almost all cases you will want to strip these quotes. The default value is "FALSE".

Example:
wrapper.app.parameter_file.stripquotes=FALSE
Example of Parameter File UTF-8:
#encoding=UTF-8
-DTEST1=Value1 -DTEST2="Test Value with spaces."

Reference: Parameters