You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Joseph Toussaint <to...@jakarta.apache.org> on 2001/09/06 00:14:29 UTC
[VOTE] adding a unix script to start tomcat with jpda
I tested this script with tomcat3.2. I'd write a win32 equivalent, but my
bat file scripting isn't strong enough. My understanding is that tomcat is
jdk1.1 compliment, and jdpa requires at least jdk1.2.2 if not jdk1.3.0
(depending on your os) - but jpda is a powerful tool and I think that this
script would be a cool addition to tomcat. Besides people don't have to
start tomcat with jdpa - it's a option.
thanks!
joe
#! /bin/sh
#
# (09-05-2001) jdtoussa@cariboulake.com
# Shell script to startup the server the JDDA debugging turned on.
# The JDPA debugger is only available in JDK1.3.0 or higher on
# Windows and Solaris. It is part of the JDK1.2.2 distribution
# on Linux.
#
# If you are running a version of the JDK that does not include
# JDPA you can download a platform dependant version from
# http://java.sun.com/products/jpda/download.html
#
# When tomcat starts up look for a line that says
#
# Listening for transport dt_socket at address: <port-number>
#
# That is the port that you need to tell the jdb client to connect to.
#
# For more information about JDPA look at the sun documentation
# http://java.sun.com/products/jdpa
OS=`uname -a | grep -i linux`
VER1_2=`java -version 2>&1 | grep 1.2.2`
VER1_3=`java -version 2>&1 | grep 1.3`
if [ "${VER1_3}" = "" ]; then
OK="false"
#At this point we know were not running 1.3 or higher
#Maybe were running JDK1.2 under Linux so were ok ...
if [ "${OS}" -ne ""] && ["${VER1_2}" = "" ]; then
echo "You must be running JKD1.2.2 or higher to use JDPA on
Linux"
exit
else
OK="true"
fi
#We can't use the JDPA
if [ "${OK}" = "false" ]; then
echo "You must be running JDK1.3.0 or higher to use JDPA"
exit
fi
fi
TOMCAT_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n"
export TOMCAT_OPTS
BASEDIR=`dirname $0`
$BASEDIR/tomcat.sh start "$@"