tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steinar Bang ...@dod.no>
Subject Re: Connect Java Profiler to Tomcat
Date Mon, 19 Aug 2002 09:04:52 GMT
>>>>> "Zhenxin wang" <zhenxin@docomolabs-usa.com>:

> I used OptimizeIt, which has special script for Tomcat 4. Follow the
> instructions from OptimizeIt to modify the script to suit your
> environment, it should be easy to gt it working.

I've aquired a test license from Borland, but haven't been able to get
it working yet.

Platform: Intel PIII, RedHat 7.2, Blackdown JDK 1.3.1_01-fcs, tomcat 3.3

Both the JDK and tomcat were installed from RPMs.

What I've done is to:
	cd /var/tomcat/
	mkdir bin
	cd bin
	ln -s /usr/bin/tomcat tomcat.sh
and then run the wizard in Tools/Application server integration.

The wizard created the files
	/var/tomcat/bin/oi_filter.oif
	/var/tomcat/bin/tomcat3_OI.sh

I've then stopped the running daemon with
	/etc/init.d/tomcat
and started the script /var/tomcat/bin/tomcat3_OI.sh.

The script outputs some text and then terminates.  After the
script has terminated no tomcat process is running.  The
output by the script, is:

# /var/tomcat/bin/tomcat3_OI.sh
/usr/java/jdk1.3.1_01/bin/java -Xbootclasspath/a:/usr/local/OptimizeitSuiteDemo/lib/oibcp.jar
 -classpath /var/tomcat/lib/tomcat.jar:/usr/local/OptimizeitSuiteDemo/lib/optit.jar:/usr/java/jdk1.3.1_01/lib/tools.jar:
-Dtomcat.home=/var/tomcat -DGCOPSIZE=5 intuitive.audit.GenericAudit org.apache.tomcat.startup.Main
start
OptimizeIt Profiler 4.11 build 449 Audit System.
(c) 1997, 1998, 1999, 2000, 2001 Borland.
Port is 1470
Using 5MB for GC operation pool
OptimizeIt generic Audit System. [Hotspot runtime detected]
EmbededTomcat: Init time 1066
EmbededTomcat: Startup time 0
#

The generated tomcat3_OI.sh script is appended to the end of this message.

All hints, tips, and guesses appreciated!

Thanx


- Steinar


-----------------wizard generated tomcat start script tomcat3_OI.sh----------
#!/bin/sh

################################################################################
# This script allows to start Jakarta Tomcat 3.1, 3.2 and 3.3 with Optimizeit  #
# tools. It should be completed before use.                                    #
# Use this script to start Tomcat with the Optimizeit Audit System selected    #
# with the Audit System Selector (<OptIt_Dir>/oiselector program).             #
# Refer to the tutorial for Tomcat 3 for more information.                     #
# (tutorials are located under <OptIt_Dir>/tutorials)                          #
################################################################################

# This entry contains the directory where you installed Tomcat
# (Ex: /home/jay/jakarta-tomcat-3.3)
TOMCAT_HOME=/var/tomcat

#This entry contains the path to the OptimizeIt directory
# (Ex: /home/ted/OptimizeitSuite4.1)
OPTIT_HOME=/usr/local/OptimizeitSuiteDemo

# This entry contains the path to the directory of the vm that you want to use
# (Ex: /home/ted/jdk1.3.1)
JAVA_HOME=/usr/java/jdk1.3.1_01

# Enter any required extra java classpath at this entry
JAVA_CLASSPATH=

# Add any extra java arguments at this entry
# (such as -D java properties used by 3rd party products)
JAVA_ARGS=

# Increase the GCOP value if you get some "GCOP buffer too small" errors
# with the Profiler (size is in Mb)
GCOPSIZE=5

# ** You should not have to modify anything below this line **
# -----------------------------------------------------------------------------

if [ ! -d "$JAVA_HOME" ] ; then
echo "The JAVA_HOME specified $JAVA_HOME does not exists."
echo "Make sure to specify a correct JAVA_HOME in the tomcat3_OI.sh script."
exit
fi

if [ -f $JAVA_HOME/bin/java ]
then
JAVA=$JAVA_HOME/bin/java
elif [ -f $JAVA_HOME/bin/jre ]
then
JAVA=$JAVA_HOME/bin/jre
else
echo "No java or jre found under the directory $JAVA_HOME"
echo "Make sure to specify a correct JAVA_HOME in the tomcat3_OI.sh script."
exit
fi

if [ ! -f "$OPTIT_HOME/lib/optit.jar" ] ; then
echo "Cannot find the OptimizeIt library optit.jar under the directory $OPTIT_HOME"
echo "Make sure to specify a correct OPTIT_HOME in the tomcat3_OI.sh script."
exit
fi
LD_LIBRARY_PATH=${LD_LIBRARY_PATH:-.}:${OPTIT_HOME}/lib
export LD_LIBRARY_PATH
OI_PATH=$PATH
export OI_PATH

if [ -z "$AUDIT" ] ; then
AUDIT=`$OPTIT_HOME/runtime/bin/jre -classpath "$OPTIT_HOME/runtime/lib/rt.jar:$OPTIT_HOME/lib/optit.jar"
intuitive.optit.fileop.JavaTester $JAVA 2> /dev/null`
fi

# Always use native threads
JAVATHREADS="-native -DOPTITTHR=native"

case $AUDIT in
"11") COMMAND="$JAVA $JAVATHREADS -noclassgc -Djava.compiler=NONE -DAUDIT=11"
JAVACP="$JAVA_HOME/lib/classes.zip:$OPTIT_HOME/lib/optit.jar";;
"118pr") COMMAND="$JAVA $JAVATHREADS -noclassgc -Djava.compiler=NONE -DAUDIT=118pr"
JAVACP="$JAVA_HOME/lib/classes.zip:$OPTIT_HOME/lib/optit.jar";;
"12") COMMAND="$JAVA $JAVATHREADS -Xrunoii -Xnoclassgc -Djava.compiler=NONE -DAUDIT=12"
JAVACP="$OPTIT_HOME/lib/optit.jar:$JAVA_HOME/lib/tools.jar" ;;
"JNI") COMMAND="$JAVA -Xrunoii -DAUDIT=jni"
JAVACP="$OPTIT_HOME/lib/optit.jar:$JAVA_HOME/lib/tools.jar" ;;
*) echo "Virtual machine not recognized, using default settings..."
COMMAND="$JAVA -Xrunoii -DAUDIT=jni"
JAVACP="$OPTIT_HOME/lib/optit.jar:$JAVA_HOME/lib/tools.jar" ;;
esac

if [ -d $TOMCAT_HOME/lib/container ]
then # 3.3
MAIN_CLASS="org.apache.tomcat.startup.Main start"
JAVACP="$TOMCAT_HOME/lib/tomcat.jar:$JAVACP:$JAVA_CLASSPATH"
else # < 3.3
MAIN_CLASS=org.apache.tomcat.startup.Tomcat
JAVACP="$JAVACP:$JAVA_CLASSPATH"
for entry in $TOMCAT_HOME/lib/* ; do
  JAVACP=$JAVACP:$entry
done
JAVACP=$JAVACP:$TOMCAT_HOME/classes
fi

echo "$JAVA -Xbootclasspath/a:$OPTIT_HOME/lib/oibcp.jar $JAVA_ARGS -classpath $JAVACP -Dtomcat.home=$TOMCAT_HOME
-DGCOPSIZE=$GCOPSIZE intuitive.audit.GenericAudit $MAIN_CLASS $@"

$COMMAND -Xbootclasspath/a:$OPTIT_HOME/lib/oibcp.jar $JAVA_ARGS -classpath $JAVACP -Dtomcat.home=$TOMCAT_HOME
-DGCOPSIZE=$GCOPSIZE intuitive.audit.GenericAudit $MAIN_CLASS $@




--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message