Installation - Startup Parameters for Java Agent on a Wildfly Application Server



Wildfly Compatibility

vFunction supports RedHat Wildfly 14.0.1 and later.


Installation Workflow

  1. Install the Dynamic Analysis Controller
  2. Find and note the base path to your Wildfly Application Server

    ### This should return the location of the bin/standalone.conf which should be in the Wildfly base path

    find / -name 'standalone.conf' -type f
  3. Find and note the location and version of the wildfly-common-VERSION.jar on your Wildfly Application Server

    find / -name wildfly-common-*.jar -type f
  4. Find and note the location and version of the jboss-logmanager-VERSION.jar on your Wildfly Application Server

    find / -name jboss-logmanager-*.jar -type f
  5. Open the vFunction JBoss startup parameters in a text editor

    ### Replace the INSTANCE_NAME below with the actual values

    vi etc/sysconfig/vfunction/agent/instances/INSTANCE_NAME/vmargs-examples/wildfly
  6. Modify the JAVA_OPTS:
    1. Change the YOUR-WILDFLY-BASE-PATH to be relevant for your environment
    2. Change the wildfly-common-VERSION.jar to be relevant for your environment
    3. Change the jboss-logmanager-VERSION.jar to be relevant for your environment
  7. Add the startup parameters to your JBoss Application Server's JAVA_OPTS:

    ### Replace the INSTANCE_NAME and YOUR_WILDFLY_BASE_PATH below with the actual values

    cat etc/sysconfig/vfunction/agent/instances/INSTANCE_NAME/vmargs-examples/wildfly >> YOUR_WILDFLY_BASE_PATH/bin/standalone.conf
  8. Restart the Wildfly instance
  9. Confirm that the Application comes up and functions as expected
  10. If any issues arise:

Sample contents of vmargs-example/wildfly file

If using this sample below, you will need to:

  1. Find-and-replace the REPLACE_BASE_DIR with the value relevant to your vFunction installation
  2. Find-and-replace the REPLACE_INSTANCE with the value relevant to your vFunction installation
  3. Identify the location and version of the wildfly-common-VERSION.jar on your Wildfly Application Server
  4. Replace the placeholder values in the sample below for the wildfly-common-VERSION.jar
  5. Identify the location and version of the jboss-logmanager-VERSION.jar on your Wildfly Application Server
  6. Replace the placeholder values in the sample below for the jboss-logmanager-VERSION.jar

This sample file can be found in /opt/vfunction/controller-installation/stuff/agent/vmargs-examples/java/wildfly. Once the install.sh script is run, the relevant placeholder fields are replaced in the version of the environmentally-specific file in /etc/sysconfig/vfunction/agent/instances/INSTANCE_NAME/wildfly.

Sudo Installation Sample
### Replace REPLACE_INSTANCE with the actual instance name, like default-java
### Replace YOUR_WILDFLY_BASE_PATH with the actual base path
### Replace VERSION with the actual version

VFUN_OPTS="-agentpath:/opt/vfunction/agent/libJVMTIAgent.so -javaagent:/opt/vfunction/agent/runtime-agent.jar -Dcom.vfunction.instance=REPLACE_INSTANCE"

export JAVA_OPTS="$VFUN_OPTS -Dsun.util.logging.disableCallerCheck=true -Djava.util.logging.manager=org.jboss.logmanager.LogManager -Xbootclasspath/a:YOUR_WILDFLY_BASE_PATH/modules/system/layers/base/org/wildfly/common/main/wildfly-common-VERSION.jar -Xbootclasspath/a:YOUR_WILDFLY_BASE_PATH/modules/system/layers/base/org/jboss/logmanager/main/jboss-logmanager-VERSION.jar $JAVA_OPTS"
Sudoless Installation Sample
### Replace REPLACE_BASE_DIR with the actual path, like /home/USERNAME/
### Replace REPLACE_INSTANCE with the actual instance name, like default-java
### Replace YOUR_WILDFLY_BASE_PATH with the actual base path
### Replace VERSION with the actual version

VFUN_OPTS="-agentpath:/REPLACE_BASE_DIR/vfunction/opt/vfunction/agent/libJVMTIAgent.so=conf=REPLACE_BASE_DIR/vfunction/etc/sysconfig/vfunction/agent/instances/REPLACE_INSTANCE/native-conf.json -javaagent:REPLACE_BASE_DIR/vfunction/opt/vfunction/agent/runtime-agent.jar=ConfigLocation=REPLACE_BASE_DIR/vfunction/etc/sysconfig/vfunction/agent/instances/REPLACE_INSTANCE/vfunction-runtime-override.properties -Dcom.vfunction.runtime.shared.folder=REPLACE_BASE_DIR/vfunction/opt/vfunction/controller/instances/REPLACE_INSTANCE/temp/ -Dcom.vfunction.runtime.offload.tmpFolder=REPLACE_BASE_DIR/vfunction/opt/vfunction/agent/instances/REPLACE_INSTANCE/temp/ -Dcom.vfunction.logging.logFile=REPLACE_BASE_DIR/vfunction/var/log/vfunction/instances/REPLACE_INSTANCE/vfagent.log"

export JAVA_OPTS="$VFUN_OPTS -Dsun.util.logging.disableCallerCheck=true -Djava.util.logging.manager=org.jboss.logmanager.LogManager -Xbootclasspath/a:YOUR_WILDFLY_BASE_PATH/modules/system/layers/base/org/wildfly/common/main/wildfly-common-VERSION.jar -Xbootclasspath/a:YOUR_WILDFLY_BASE_PATH/modules/system/layers/base/org/jboss/logmanager/main/jboss-logmanager-VERSION.jar $JAVA_OPTS"