JBoss, Wildfly Application Server

Installation

For general Agent installation instructions, see Set up Agents.

32 bit

-agentpath:"<DT_HOME>\agent\lib\dtagent.dll"=name=<AgentName>,server=<collectorName>  

64 bit

-agentpath:"<DT_HOME>\agent\lib64\dtagent.dll"=name=<AgentName>,server=<collectorName>  
Note

For Windows, the unconventional nested double quotes set in "JAVA_OPTS=...-agentpath:"<pathWithSpace>..."..."" (set "JAVA_OPTS=...-agentpath:"<pathWithSpace>..."...") are correct. A known bug in JBoss versions 8.1.0 and 8.2.0 prevents usage of spaces in the JAVA_OPTS environment variable. To work around this issue:

  • Use the latest version 8 (8.2.1) if possible.
  • If you can install to a space-less path you can get along with 8.1.0 or 8.2.0.
  • You can apply a special treatment to / edit standalone.bat.

Wildfly 8.x - 10.0.0 and JBoss 7

Note

WildFly 10 does not deliver any pool statistics if the data source has not set the enable statistics flag.

Do one of the following depending on whether Wildfly 8/JBoss 7 runs in standalone or domain mode.

Standalone mode

Extend the environment variable JAVA_OPTS. For example, -agentpath:<DT_HOME>\agent\lib\\dtagent.dll=name=<AgentName>,server=<dynatraceCollectorName>, where <DT_HOME> represents the AppMon installation directory.

Edit <JBossHome>\bin\standalone.conf.bat as shown in the set line below.

...
rem # Use JBoss Modules lockless mode
rem set "JAVA_OPTS=%JAVA_OPTS% -Djboss.modules.lockless=true"

rem # dynaTrace Agent Injection
set "JAVA_OPTS=%JAVA_OPTS% -agentpath:"<DT_HOME>\agent\lib\dtagent.dll"=name=<AgentName>,server=<dynaTraceCollectorName>"

:JAVA_OPTS_SET

Domain mode

Set the Agent options per server group or every individual server instance.

To set the Agent options per server group, modify <JBossHome>\domain\configuration\domain.xml as shown below.

...
    <server-groups>
        <server-group name="main-server-group" profile="full">
            <jvm name="default">
                <heap size="64m" max-size="512m"/>
                    <jvm-options>
                        <option value="-agentpath:"<DT_HOME>\agent\lib\dtagent.dll"=name=<AgentName>,server=<dynaTraceCollectorName>"/>
                    </jvm-options>
                </jvm>
            <socket-binding-group ref="full-sockets"/>
        </server-group>
    </server-groups>
</domain>

To set the Agent options for every individual server, edit <JBossHome>\domain\configuration\host.xml as shown below.

...
    <server name="server-one" group="main-server-group">
        <jvm name="default">
            <jvm-options>
                <option value="-agentpath:"<DT_HOME>\agent\lib\dtagent.dll"=name=<AgentName-Server-one>,server=<dynaTraceCollectorName>"/>
            </jvm-options>
        </jvm>
    </server>
...

JBoss 6

  1. Extend the environment variable JAVA_OPTS. For example, -agentpath:<DT_HOME>\agent\lib\\dtagent.dll=name=<AgentName>,server=<dynatraceCollectorName>, where <DT_HOME> represents the AppMon installation directory.
  2. Modify <JBossHome>\bin\run.conf.bat as shown in the set line below.
# Sample JPDA settings for remote socket debuging
# JAVA_OPTS="$JAVA_OPTS -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n"

# Sample JPDA settings for shared memory debugging
# JAVA_OPTS="$JAVA_OPTS -Xrunjdwp:transport=dt_shmem,server=y,suspend=n,address=jboss"

rem # dynaTrace Agent Injection
set "JAVA_OPTS=%JAVA_OPTS% -agentpath:"<DT_HOME>\agent\lib\dtagent.dll"=name=<AgentName>,server=<dynaTraceCollectorName>"

:JAVA_OPTS_SET

JBoss 5

  1. Extend the environment variable JAVA_OPTS. For example, -agentpath:<DT_HOME>\agent\lib\\dtagent.dll=name=<AgentName>,server=<dynatraceCollectorName>, where <DT_HOME> represents the AppMon installation directory.
  2. Modify <JBossHome>\bin\run.bat as shown in the set JAVA_OPTS line below.
...
rem Setup the java endorsed dirs
set JBOSS_ENDORSED_DIRS=%JBOSS_HOME%\lib\endorsed
set JAVA_OPTS=%JAVA_OPTS% -agentpath:"<DT_HOME>\agent\lib\dtagent.dll"=name=<AgentName>,server=<dynaTraceCollectorName>

echo ===============================================================================
echo .
echo JBoss Bootstrap Environment
echo .
echo JBOSS_HOME: %JBOSS_HOME%
echo .
echo JAVA: %JAVA%
echo .
echo JAVA_OPTS: %JAVA_OPTS%
echo .
echo CLASSPATH: %JBOSS_CLASSPATH%
echo .
echo ===============================================================================
echo .

:RESTART
"%JAVA%" %JAVA_OPTS% "-Djava.endorsed.dirs=%JBOSS_ENDORSED_DIRS%" -classpath "%JBOSS_CLASSPATH%" org.jboss.Main %*
IF ERRORLEVEL 10 GOTO RESTART

:END
if "%NOPAUSE%" == "" pause

:END_NO_PAUSE

See the external page Enable Monitoring in JBoss Domain Modes for more details about JBoss Domain Mode.