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
Download the Websphere Liberty runtime ZIP file.
Extract the files to the location where you want the server to run.
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/dropinsfolder.To set up the server to work with Contrast, create a
jvm.optionsfile in thewlp/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/Contrastwith 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, orproduction.
To have the settings in the
jvm.optionsfile take effect, restart the WebSphere Liberty server.