Re: JAVA agent REdhat Tomcat (699 Views)
Reply
Valued Contributor
Posts: 352
Registered: ‎11-29-2011
Message 1 of 6 (743 Views)
Accepted Solution

JAVA agent REdhat Tomcat

Hello expert,

 

How do I intrument tomcat to automatically start Java Probe in redhat? In debian I've attached the parameter into the /etc/init.d/tomcat script and it work fine but it doesnt seem to work in red hat.

 

CATALINA_HOME=/opt/tomcat
export PATH=$PATH:/usr/java/jdk1.6.0_30/bin
export JAVA_PATH=$JAVA_PATH:/usr/java/jdk1.6.0_30/bin
export JRE_PATH=$JRE_PATH:/usr/java/jdk1.6.0_30/bin
JAVA_OPTS="$JAVA_OPTS -Xbootclasspath/p:/usr/local/JavaAgent/DiagnosticsAgent/classes/boot/instr.jre"
JAVA_OPTS="$JAVA_OPTS -javaagent:/usr/local/JavaAgent/DiagnosticsAgent/lib/probeagent.jar"

 

Tomcat start fine but it doesnt autostart the Javaprobe. Any advice is greatly appreciate

 

Dunno if it make any different when tomcat run i get the following

Using CATALINA_BASE:   /opt/tomcat
Using CATALINA_HOME:   /opt/tomcat
Using CATALINA_TMPDIR: /opt/tomcat/temp
Using JRE_HOME:        /usr
Using CLASSPATH:       /opt/tomcat/bin/bootstrap.jar

 

my first reaction is the JRE_HOME is not set....does that make a different?

Also when i run ./jreinstrumenter.sh -a /usr/java

Sun 1.6.0_30 (/usr/java/jdk1.6.0_30/jre)
Sun 1.6.0_30 (/usr/java/default/jre)
Sun 1.6.0_30 (/usr/java/latest/jre)

 

how do i know which one to use? I tested the top 2 and it didnt seem to work

 

Thank you

 

Valued Contributor
Posts: 352
Registered: ‎11-29-2011
Message 2 of 6 (742 Views)

Re: JAVA agent REdhat Tomcat

I've also try passing the instrumentaion as:

JAVA_OPTS="-Xbootclasspath/p:/usr/local/JavaAgent/DiagnosticsAgent/classes/Sun/1.6.0_30/instr.jre -javaagent:/usr/local/JavaAgent/DiagnosticsAgent/lib/probeagent.jar"

 

 

 

Valued Contributor
Posts: 352
Registered: ‎11-29-2011
Message 3 of 6 (719 Views)

Re: JAVA agent REdhat Tomcat

any idea anyone?

Valued Contributor
Posts: 352
Registered: ‎11-29-2011
Message 4 of 6 (715 Views)

Re: JAVA agent REdhat Tomcat

Problem solved...Close thread thank

Regular Advisor
Posts: 150
Registered: ‎08-12-2010
Message 5 of 6 (706 Views)

Re: JAVA agent REdhat Tomcat

It will be really helpful if you put the solution also.

 

Thanks

 

Jaise

Valued Contributor
Posts: 352
Registered: ‎11-29-2011
Message 6 of 6 (699 Views)

Re: JAVA agent REdhat Tomcat

Here are the step I've too:

First I had to set JAVA_HOME and PATH in /etc/profile

Second the way I declare the JAVA_OPTS was wrong (correct way is JAVA_OPTS="$JAVA_OPTS -javaagent"

Third I notice that the jreinstrumenter result for xbootclass return the following

"-Xbootclasspath/p:/usr/local/JavaAgent/DiagnosticsAgent/classes/boot/instr.jre"

The above path fail when i execute it which is why my script been failing to start the javaagent, I've change it to

"-Xbootclasspath/p:/usr/local/JavaAgent/DiagnosticsAgent/classes/boot"  and that work fine

The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.