2.2. Configuring the Wrapper
Abstract
ServiceName-wrapper.conf
file, which is located under the InstallDir/etc/
directory.
Overview
ServiceName-wrapper.conf
file, which is located under the InstallDir/etc/
directory.
- Environment variables
- Properties passed to the JVM
- Classpath
- JMX settings
- Logging settings
JAVA_HOME
environment variable.
Specifying the Red Hat JBoss Fuse's environment
JAVA_HOME
—the Java runtime install directory.KARAF_HOME
—the location of the Red Hat JBoss Fuse install directory.KARAF_BASE
—the root directory containing the configuration and OSGi data specific to the broker instance.The configuration for the broker instance is stored in theKARAF_BASE/conf
directory. Other data relating to the OSGi runtime is also stored beneath the base directory.KARAF_DATA
—the directory containing the logging and persistence data for the broker.
Example 2.1. Default Environment Settings
set.default.JAVA_HOME=JavaInstallDir set.default.KARAF_HOME=InstallDir set.default.KARAF_BASE=InstallDir set.default.KARAF_DATA=InstallDir\data
JAVA_HOME
either as a system variable in the registry (for example, through the system control panel) or in ServiceName-wrapper.conf
, as shown in the preceding example. Setting JAVA_HOME
as a regular environment variable, however, does not work.
Passing parameters to the JVM
wrapper.java.additional.<n>
. <n> is a sequence number that must be distinct for each parameter.
wrapper.java.additional.<n>=-DPropName=PropValue
.
Example 2.2. Default Java System Properties
# JVM # note that n is the parameter number starting from 1. wrapper.java.additional.1=-Dkaraf.home="%KARAF_HOME%" wrapper.java.additional.2=-Dkaraf.base="%KARAF_BASE%" wrapper.java.additional.3=-Dkaraf.data="%KARAF_DATA%" wrapper.java.additional.4=-Dcom.sun.managment.jmxremote wrapper.java.additional.5=-Dkaraf.startLocalConsole=false wrapper.java.additional.6=-Dkaraf.startRemoteShell=true wrapper.java.additional.7=-Djava.endorsed.dirs="%JAVA_HOME%/jre/lib/endorsed;%JAVA_HOME%/lib/endorsed;%KARAF_HOME%/lib/endorsed" wrapper.java.additional.8=-Djava.ext.dirs="%JAVA_HOME%/jre/lib/ext;%JAVA_HOME%/lib/ext;%KARAF_HOME%/lib/ext"
Adding classpath entries
wrapper.java.classpath.<n>
. <n> is a sequence number that must be distinct for each classpath entry.
Example 2.3. Default Wrapper Classpath
wrapper.java.classpath.1=%KARAF_BASE%/lib/karaf-wrapper.jar wrapper.java.classpath.2=%KARAF_HOME%/lib/karaf.jar wrapper.java.classpath.3=%KARAF_HOME%/lib/karaf-jaas-boot.jar wrapper.java.classpath.4=%KARAF_BASE%/lib/karaf-wrapper-main.jar
JMX configuration
- Locate the line
# Uncomment to enable jmx
.There are three properties, shown in Example 2.4, “Wrapper JMX Properties”, that are used to configure JMX.Example 2.4. Wrapper JMX Properties
# Uncomment to enable jmx #wrapper.java.additional.n=-Dcom.sun.management.jmxremote.port=1616 #wrapper.java.additional.n=-Dcom.sun.management.jmxremote.authenticate=false #wrapper.java.additional.n=-Dcom.sun.management.jmxremote.ssl=false
- Remove the
#
from in front of each of the properties. - Replace the
n
in each property to a number that fits into the sequence of addition properties established in the configuration.
Configuring logging
Table 2.2. Wrapper Logging Properties
Property | Description |
---|---|
wrapper.console.format |
Specifies how the logging information sent to the console is formated. The format consists of the following tokens:
|
wrapper.console.loglevel | Specifies the logging level displayed on the console. |
wrapper.logfile | Specifies the file used to store the log. |
wrapper.logfile.format | Specifies how the logging information sent to the log file is formated. |
wrapper.console.loglevel | Specifies the logging level sent to the log file. |
wrapper.console.maxsize | Specifies the maximum size, in bytes, that the log file can grow to before the log is archived. The default value of 0 disables log rolling. |
wrapper.console.maxfiles | Specifies the maximum number of archived log files which will be allowed before old files are deleted. The default value of 0 implies no limit. |
wrapper.syslog.loglevel | Specifies the logging level for the sys/event log output. |