Using DevTest Agents with other Java Agents

Document ID : KB000010956
Last Modified Date : 24/01/2019
Show Technical Document Details

A Java agent is a JVM “plugin”. It is loaded at JVM initialization, before most Java classes and before any program classes. As classes are loaded by the Java classloader, the agent can modify the class’s bytecode by inserting custom code (called instrumenting a class). Security is governed by the same security context applicable for the classloaders. There are two main categories for java agents: profilers and behavior monitors/modifiers.

All Supported DevTest Environments


These agents collect JVM level statistics such as cpu and memory usage, garbage collection activities, number of classes loaded, etc.  Agents in this category usually only monitor/modify JVM level classes. The DevTest Java Agent can usually coexist with this type of agent.
Examples: DevTest Java Agent, Wily Agent, etc.


Behavior Monitors/Modifiers:
These agents modify the byte code of each class during run time. They are used to monitor or change the behavior of individual classes. The DevTest Java Agent usually has issues coexisting with this type of agent.
Examples: DevTest Java Agent, JaCoCo Agent, etc.

DevTest and Other Agents:
The DevTest Java Agent is unusual because it falls into both categories. It has basic JVM profiling features but also modifies each class allowing it to record internal application messages or redirect them to a Virtual Service Environment when needed.

Because every agent adds/modifies byte code, it is impossible to know if the DevTest Java Agent can coexist with other agents without trying.

Specific Agents and Known Solutions/Issues:
Wily Agent: The DevTest Java Agent can coexist with the Wily Introscope Agent as it not directly interfering with Java classes.
The DevTest Java Agent must be loaded before the Wily Agent.

JaCoCo Agent: Uses class instrumentation to record execution coverage data. It instruments each program class, similar to the DevTest Java Agent.
DevTest Java Agent cannot coexist with JaCoco Agent. 

Jasmine.jar Agent: Is used with HP Testing Tools. If this agent is loaded using environmental variables like "JAVA_TOOL_OPTIONS", it can cause issues with all DevTest components including the Dashboard, Registry and Portal. The only solution is to remove the environmental variables that cause the agent to be loaded.

In general:

  • The DevTest Java Agent should be loaded before any other agent. If you are using the -javaagent syntax for both agents, specify the DevTest Java Agent first.
  • If needed, use the DevTest Agent exclude statements. See the DevTest documentation for more details.
  • Open a support ticket if assistance is required.



Additional Information:

Not Applicable