tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <>
Subject RE: How to identify version of a running Tomcat and similar trivia
Date Thu, 02 Feb 2006 10:15:20 GMT
Hi Tim,

yes, at least the later Tomcat release of HP has such a method

# find /opt/hpws/tomcat -type f -name catalina.jar|xargs -n1 jar
tf|grep -F

# cd /tmp

# find /opt/hpws/tomcat -type f -name catalina.jar|xargs -n 1 -I
CLASS jar xf CLASS org/apache/catalina/util/

# ll /tmp/org/apache/catalina/util  
total 16
-rw-r--r--   1 root       sys             30 Feb  2 11:01

# file /tmp/org/apache/catalina/util/ 
/tmp/org/apache/catalina/util/    sed
program text

# cat /tmp/org/apache/catalina/util/ Tomcat/4.1

Ok, this is probably a pretty weird hack to identify a Tomcat,
but it seems to be sufficiently reliable, and can be casted into
a script.
So from the proc table entry of the running Java master thread I
will have to parse the full args
token to retreive the classpath and jar dirs in the startup
command line.
Then I could run this find and extract stuff like above.
What I still dislike is the need for a temporal extraction
directory for a mere 30 byte string.
I will have to find out a way if I could extract this into a

Still, I would hope the Tomcat developers could devise an easy
and straight forward way to query this info
from the shell.
Come on lads, this should only take less than half an hour for a
decent Java hacker.

> -----Original Message-----
> From: Tim Funk []
> Sent: Wednesday, February 01, 2006 6:39 PM
> To: Tomcat Users List
> Subject: Re: How to identify version of a running Tomcat and
> trivia
> Tomcat is like any server based java app. It will always 
> require a convulted 
> classpath as well as multiple classloaders to do anything
> The most failsafe way to get the version regarless of the 
> packaging is to do 
> the following: (no, i'm not kidding)
> 1) find catalina.jar. It *should* be in 
> server/lib/catalina.jar of your 
> tomcat installation
> 2) Open it with winzip like program
> 3) Look for (in
> 4) In that file is ther server version
> The script is just a wrapper the created the 
> appropriate classpath 
> so that the properties file can be loaded.
> -Tim
> wrote:
> > Hi Tim,
> > <SNIP>
> > 
> > Only problem is, my Tomcat depot on this box (randomly picked
> > of our HP-UX boxes, but we also have Tomcats running on
> > AIX, Solaris (and probably Win32) doesn't seem to have
> > such a wrapper script.
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message