Skip to main content

Configure the Java agent for WebSphere Liberty

Use this procedure to configure a Java agent for a WebSphere Liberty server.

Before you begin

Download the download the Java agent JAR from one of these repositories:

Steps

  1. Download the Websphere Liberty runtime ZIP file.

  2. Extract the files to the location where you want the server to run.

  3. Start the server on port 9080 with this command:

    bin/server start

    To deploy a WAR file, put it in the /usr/servers/server-name/dropins folder.

  4. To set up the server to work with Contrast, create a jvm.options file in the wlp/usr/servers/server-name/ folder. The settings in the file should be similar to this example:

    -javaagent:/<path to jar>/contrast.jar
    -Dcontrast.log=/<path to log>/contrast.log
    -Dcontrast.teamserver.url=https://teamserver.mycompany.com/Contrast
    -Dapplication.name=<my-app-name>
    -Dcontrast.env=<env>
    -Xmx512m
    • Replace <path to jar> with the path to were your Java JAR file is located.

    • Replace <path to log> with the path to your Contrast log file. The default location is: $CONTRAST_HOME/data/logs.

    • Replace https://teamserver.mycompany.com/Contrast with the URL for your Contrast instance.

    • Replace <my-app-name> with the name of your application.

    • Replace <env> with the environment where you are running the server: development, qa, or production.

  5. To have the settings in the jvm.options file take effect, restart the WebSphere Liberty server.