tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier ...@ice-sa.com>
Subject Re: jstack and Tomcat 6 on Windows
Date Fri, 19 Sep 2008 23:57:44 GMT
Brian Clark wrote:
> Thanks everyone for their suggestions. 
> 
> Unfortunately, that doesn't help me with my particular issue. I have a memory leak in
one of my apps, and when the system runs out of memory, it stops responding to new requests.
I have a script that will detect this condition and automatically restart Tomcat. I was hoping
to add a jstack command to this script to give me a thread dump prior to restarting Tomcat
to give me better troubleshooting information. Your solution would work under normal circumstances,
but I don't know how to script a ctrl+break.  ;-)
> 

But maybe it would help you, if some conditions are met :

If this Windows machine can be left with Tomcat running in a command 
window (instead of as a Windows service in the background).
You say you could do this with jstack (?), if this Tomcat was running in 
a way similar as under Unix/Linux (meaning a java process runnning 
bootstrap.jar, right ?).

If that is the case, then do as follows (it's longer to type than to do):
- if not already so, download and install a Java 6 JDK on that machine
(ok, that may take a while..)
- download the "zip" package of Tomcat6, as I suggested
- extract the content somewhere
- as Johnny suggested, copy the files from that unzipped /bin directory, 
to the current /bin directory of your Tomcat msi installation.  Those 
files seem to be the usual startup.bat and catalina.bat etc.. 
(corresponding to the startup.sh and catalina.sh of Unix/Linux 
versions). That zip probably also contains the same tomcat6.exe and 
tomcat6W.exe that you have already, so you might be able to copy the 
whole bin directory over the other one.
- fix up what is needed to have JAVA_HOME, JAVA_OPTS, CATALINA_HOME 
correctly defined (setenv.bat ?)
- in a command window, navigate to that bin directory and enter 
".\startup.bat".  That will start Tomcat right here, under Java, as a 
command-line application.

The main process will then be Java, which is what you are looking for, no ?
All your applications will work in exactly the same way.
Your script should work equally well whether Tomcat is running as a 
Windows Service, or just as an application, no ?
You might even see messages to the console that you've missed before.



---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message