To install the Java Agent on JBoss Standalone (Linux)
-
Open the
bin/standalone.shfile. -
Add the following
javaagentargument:export JAVA_OPTS="$JAVA_OPTS -javaagent:/agent_install_dir/javaagent.jar" -
Specify the argument above the following section
of
standalone.sh:... while true;do if [ "x$LAUNCH_JBOSS_IN_BACKGROUND" = "X" ]; then # Execute the JVM in the foreground eval \"$JAVA\" -D\"[Standalone]\"$JAVA_OPTS \ \"-Dorg.jboss.boot.log.file=$JBOSS_LOG_DIR/boot.log\" \ \"-Dlogging.configuration=file:$JBOSS_CONFIG_DIR/logging.properties\" \ -jar \"$JBOSS_HOME/jboss-modules.jar\" \ - Restart the application server.
-
Add the following to the end of the
standalone.conffile in theJAVA_OPTSsection:-Djava.util.logging.manager=org.jboss.logmanager.LogManager -Xbootclasspath/p:{{}} <path_to_jboss_logmanager>/jboss-logmanager-<version>.jarFor JDK9 and above,-Xbootclasspath/poption has been removed; use-Xbootclasspath/ainstead:-Djava.util.logging.manager=org.jboss.logmanager.LogManager -Xbootclasspath/a:<path_to_jboss_logmanager>/jboss-logmanager-<version>.jar -
Replace
<path_to_jboss_logmanager>and<version>with the path and log manager JAR filename for your system.See Making the LogManager Location Dynamic for information on making the path dynamic.Note: Step 5 and Step 6 are required only if the log manager errors manifest. Also, repeat Step 4 after this change.