World Map
Java Service Wrapper is the easiest way to make your product more reliable.
  • Free Trial
  • Buy Now
wrapper.app.parameter.<n> Property

Index

wrapper.app.parameter.<n>

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

Application parameters to pass to your application when it is launched. These are the parameters passed to your application's main method.

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

<n> component:

Each element has a property name which 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 which 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 followings 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.default.stripquotes

Compatibility :3.5.17
Editions :Professional EditionStandard EditionCommunity Edition
Platforms :Windows (Not Supported)Mac OSXLinuxIBM AIXFreeBSDHP-UXSolarisIBM z/OSIBM 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/OSIBM 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 which 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.stripquotes

Compatibility :3.5.17
Editions :Professional EditionStandard EditionCommunity Edition
Platforms :WindowsMac OSXLinuxIBM AIXFreeBSDHP-UXSolarisIBM z/OSIBM 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. To be consistent with the way the wrapper.app.parameter.<n>.stripquotes property works, this property defaults to the value of the wrapper.app.parameter.default.stripquotes property, which itself defaults to "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