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


Jetty Compatibility

vFunction supports Eclipse Jetty version 9.4.20 and later.


Installation Workflow

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

    ### This should return the location of the bin/setenv.sh which should be in the Jetty Application Server's JETTY_HOME

    find / -name 'jetty.sh' -type f
  3. Open the Jetty Application Server's Startup Script in a text editor

    ### Replace the JETTY_HOME with the actual value

    vi JETTY_HOME/bin/jetty.sh
  4. Find the section of the file for setting the Java VM options

    /Java VM options
  5. Add a section for the vFunction Startup Parameters above the comment to "Add jetty properties to Java VM options." Copy and paste the details below.

    #####################################################
    # Add vFunction options.
    #####################################################

    VFUN_OPTS=""

    JAVA_OPTIONS="$JAVA_OPTIONS $VFUN_OPTS"
  6. Create a variable with the vFunction Agent Startup Parameters

    ### Replace the INSTANCE_NAME with the actual value

    export VFUN_OPTS=`cat etc/sysconfig/vfunction/agent/instances/INSTANCE_NAME/vmargs-examples/raw`
  7. Modify the jetty.sh VFUN_OPTS to include the vFunction Agent Startup Parameters

    ### Replace the JETTY_HOME with the actual value

    sed -i "s~VFUN_OPTS=\"\"~VFUN_OPTS=\"$VFUN_OPTS\"~g" JETTY_HOME/bin/jetty.sh
  8. Restart the Jetty instance
  9. Confirm that the Application comes up and functions as expected
  10. If any issues arise:

Sample contents of vmargs-example/raw 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

This sample file exists in the Installation TGZ in /opt/vfunction/controller-installation/stuff/agent/vmargs-examples/java/raw. 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/raw.

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