Skip to content

Configure Glassfish for Lightrun

Glassfish is an open source Java application server by Oracle. The domain.xml file contains most of the Oracle GlassFish Server configurations.

To start using Lightrun with a Glassfish server, first add the agent path as a JVM option to the Glassfish java-config block as in this example from lines 165-169.

To configure Glassfish for Lightrun

You can add the agent path option with any of these options:

  • from the Glassfish Admin panel

    1. Copy the agent path option.

      -agentpath:<install_dir>/agent/lightrun_agent.so=--lightrun_extra_class_path=<glassfish-domain-path>/applications/<app-name>/WEB-INF/classes/
    

    2. Navigate to the Admin panel (usually at http://localhost:4848)

    3. Go to Configurations=> server-config

    4. Select the JVM Options tab.

    4. Paste the option in the dialog box.

  • from your CLI

    1. Connect to your Glassfish server (usually at http://localhost:4848).

    2. Copy the following, update it based on your configurations and then run the asadmin create-jvm-options command from the terminal:

      asadmin create-jvm-options -agentpath:<install_dir>/agent/lightrun_agent.so=--lightrun_extra_class_path=<glassfish-domain-path>/applications/<app-name>/WEB-INF/classes/
    
  • manually from the Glassfish domain.xml file

    1. Copy the agent path option.

      -agentpath:<install_dir>/agent/lightrun_agent.so=--lightrun_extra_class_path=<glassfish-domain-path>/applications/<app-name>/WEB-INF/classes/
    

    2. Navigate to <glassfish-domain-path>/config/domain.xml

    3. Paste the option in the java-config block of the file and save the changes.

Note

  • This configuration enables the Lightrun agent to run every time the webserver restarts.
  • Glassfish autodeploy (dynamic deployment) does not start a new agent. The agent should be restarted in order to apply new actions.

Last update: April 6, 2021