Skip to main content

WildFly integration

For general setup guidance, refer to the Application Agent page.

The Application Agent's scanning algorithm does not fully support WildFly's modular architecture, which means it does not work for detecting application classes after deployment.

As a result, paths to application archives (JAR/WAR/EAR) must be specified directly in the agent parameters:

  1. Copy the Drill4J agent files into the wildfly/bin/agent directory.

    Ensure that all the necessary files from Drill4J are present, including the drill_agent.dll (or libdrill_agent.so for Linux).

  2. Modify the WildFly startup configuration:

    For Windows, edit the bin/standalone.conf.bat file. On Linux, modify the bin/standalone.conf file.

    Add the following line to the configuration file:

    Windows:

    set "JAVA_OPTS=%JAVA_OPTS% -Djboss.modules.system.pkgs=com.epam.drill -agentpath:agent/drill_agent.dll"

    Linux:

    JAVA_OPTS="$JAVA_OPTS -Djboss.modules.system.pkgs=com.epam.drill -agentpath:agent/libdrill_agent.so"

    This ensures that WildFly will load the Drill4J agent when the server starts.

    The -Djboss.modules.system.pkgs=com.epam.drill option allows WildFly to load classes from the com.epam.drill package, enabling proper integration with the Drill4J agent. Without it, the agent may not function correctly due to class loading restrictions.

  3. Configure the agent to scan your application:

    In the drill.properties file (located in the agent's directory), add the scanClassPath parameter to point to the application archive (WAR or EAR) you want to monitor. For example:

    # Adjust the path to match the location of your deployed WAR file.
    # You can also specify multiple paths using a semicolon (`;`) as a delimiter.
    scanClassPath=C:/java/wildfly/standalone/deployments/helloworld.war
  4. Restart WildFly and verify:

    After modifying the configuration and properties files, restart WildFly. Drill4J should now detect the classes in your WAR or EAR application and start sending data.

This setup ensures Drill4J is correctly integrated with your WildFly server, allowing Application Agent to detect the application classes.

Troubleshooting#

  • If the agent isn't detecting your application, verify that the correct scanClassPath is set in the drill.properties file.
  • Ensure the agent is correctly loaded by reviewing WildFly logs and checking the Troubleshooting section in the Drill4J documentation.

Limitations#

The Drill4J Application Agent cannot detect new applications deployed to WildFly while it is already running. To allow the Application Agent to detect new application classes, WildFly must be restarted.