Diagnostics Java agent for application server Tomee 1.7.4 -Tomcat 7.0.68

  • KM03637049
  • 30-Apr-2020
  • 30-Apr-2020

Summary

Diagnostics Java agent 9.50 instrumentation for pplication server Tomee 1.7.4 -Tomcat 7.0.68)tomcat+J2EE https://en.wikipedia.org/wiki/Apache_TomEE)

Question

After a fresh Java Agent Installation we cannot configure Java agent for application server Tomee 1.7.4 -Tomcat 7.0.68)tomcat+J2EE https://en.wikipedia.org/wiki/Apache_TomEE)

Customer uses tomee.sh for starting and stop of the services.

Initially we tried with adding the parameters in tomee.sh file and restarted the services, since it was not reporting we tried with catalina.sh and restarted the application services by the below commands,

As per the application team they say that the Tommee Application service is being managed by tommee.sh script.

Running the jreinstrumenter.sh we have the below input.

[root@mv2mozott01 bin]# ./jreinstrumenter.sh -i /usr/java/jdk1.8.0_151/jre/

-Xbootclasspath/p:/tmp/Diagnostics_JavaAgent_9.50_UNIX/DiagnosticsJavaAgent/classes/Oracle/1.8.0_151/instr.jre -javaagent:/tmp/Diagnostics_JavaAgent_9.50_UNIX/DiagnosticsJavaAgent/lib/probeagent.jar

Later we split the instrumentation parameters with Probe_OPTS based on the document and updated the script manually,

PROBE_OPTS="-Xbootclasspath/p:/tmp/Diagnostics_JavaAgent_9.50_UNIX/DiagnosticsJavaAgent/classes/Oracle/1.8.0_151/instr.jre"
PROBE_OPTS="$PROBE_OPTS -javaagent:/tmp/Diagnostics_JavaAgent_9.50_UNIX/DiagnosticsJavaAgent/lib/probeagent.jar"

We have tried to parameter both the files (Tomee.sh and Catalina.sh) and in both scenarios the agent didn't communicate.

Java_Home is already set on the server:
JAVA_HOme: /usr/java/jdk1.8.0_151$

Ping and telnet to the mediator are OK

 

Answer

Since it's running as a service, please consider the workaround below:

Use a script to start the service, before starting the service, define a JAVA_TOOL_OPTIONS env variable to hook up the Diagnostics java agent.”


You might need to add Java Agent paramters directly to the /etc/init.d/tomee file, and it should work now.