Re: jstack and Tomcat 6 on Windows

2008-09-23 Thread Peng Tuck Kwok
Hmm if you have a memory leak in the application perhaps you can profile it
using a profiler. Try the one in eclipse and attach as a remote client to
the vm running tomcat.

On Sat, Sep 20, 2008 at 6:58 AM, Brian Clark [EMAIL PROTECTED] 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.
  ;-)

 - Original Message 

 From: Johnny Kewl [EMAIL PROTECTED]

 If you need thread dumps

 Start TC from the BAT file.
 When you need a dump... press ctrl + break from term window... easier than
 Jstack...






RE: jstack and Tomcat 6 on Windows

2008-09-22 Thread Surendrakumar Viswanathan -X (suviswan - HCL at Cisco)
Check Eclipse Memory Analyzer Tool www.eclipse.org/mat/. This is
alternate to JMAP, but it can parse the hprof file faster and have a
very visual GUI.

Thanks
Suren 

 -Original Message-
 From: Johnny Kewl [mailto:[EMAIL PROTECTED] 
 Sent: Saturday, September 20, 2008 4:40 PM
 To: Tomcat Users List
 Subject: Re: jstack and Tomcat 6 on Windows
 
  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. ;-)
 
  
 
 OK... I couldnt resist giving it a little go... JHat is 
 exactly what you looking for...
 http://weblogs.java.net/blog/jfarcand/archive/2006/02/using_mu
 stangs.html
 
 Well done Sun... its exactly what I've been looking for...
 
 Let the server run a little do a dump, run the server and 
 then from the browser to the HIST option...
 
 The highest non Sun class... webapp class... is going to be 
 the bad guy ;)
 
 Damn thats nice...
 
 --
 -
 HARBOR : http://www.kewlstuff.co.za/index.htm
 The most powerful application server on earth.
 The only real POJO Application Server.
 See it in Action : 
 http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm
 --
 - 
 
 
 -
 To start a new topic, e-mail: users@tomcat.apache.org To 
 unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 

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



RE: jstack and Tomcat 6 on Windows

2008-09-22 Thread Surendrakumar Viswanathan -X (suviswan - HCL at Cisco)
OOPS It's alternate to JHAT and not JMAP.

Suren 

 -Original Message-
 From: Surendrakumar Viswanathan -X (suviswan - HCL at Cisco) 
 Sent: Monday, September 22, 2008 3:25 PM
 To: 'Tomcat Users List'
 Subject: RE: jstack and Tomcat 6 on Windows
 
 Check Eclipse Memory Analyzer Tool www.eclipse.org/mat/. This 
 is alternate to JMAP, but it can parse the hprof file faster 
 and have a very visual GUI.
 
 Thanks
 Suren 
 
  -Original Message-
  From: Johnny Kewl [mailto:[EMAIL PROTECTED]
  Sent: Saturday, September 20, 2008 4:40 PM
  To: Tomcat Users List
  Subject: Re: jstack and Tomcat 6 on Windows
  
   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. ;-)
  
   
  
  OK... I couldnt resist giving it a little go... JHat is 
 exactly what 
  you looking for...
  http://weblogs.java.net/blog/jfarcand/archive/2006/02/using_mu
  stangs.html
  
  Well done Sun... its exactly what I've been looking for...
  
  Let the server run a little do a dump, run the server and then 
  from the browser to the HIST option...
  
  The highest non Sun class... webapp class... is going to be the bad 
  guy ;)
  
  Damn thats nice...
  
  --
  -
  HARBOR : http://www.kewlstuff.co.za/index.htm
  The most powerful application server on earth.
  The only real POJO Application Server.
  See it in Action : 
  http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm
  --
  -
  
  
  
 -
  To start a new topic, e-mail: users@tomcat.apache.org To 
 unsubscribe, 
  e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  
  

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



Re: jstack and Tomcat 6 on Windows

2008-09-22 Thread Johnny Kewl


- Original Message - 
From: Surendrakumar Viswanathan -X (suviswan - HCL at Cisco) 
[EMAIL PROTECTED]

To: Tomcat Users List users@tomcat.apache.org
Sent: Monday, September 22, 2008 11:55 AM
Subject: RE: jstack and Tomcat 6 on Windows


Check Eclipse Memory Analyzer Tool www.eclipse.org/mat/. This is
alternate to JMAP, but it can parse the hprof file faster and have a
very visual GUI.

Thanks
Suren



Cool, if people just chat about how they find these out of mem errors, this 
will become a very cool thread...

Up until I discovered these tools, it seems such a black hit and miss art.

... before this I actually cant think of anything that let one peek inside 
those class loaders... short of writing your own code...


In earlier threads there are also guys trying to figure out why TC wont let 
go... it holds... and I'm wondering if JHat wouldnt be able to help in those 
area's as well...

... its this class that wont let go... etc.

... it looks really nice

... did it help you, did you find the leak?

---
HARBOR : http://www.kewlstuff.co.za/index.htm
The most powerful application server on earth.
The only real POJO Application Server.
See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm
--- 



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



Re: jstack and Tomcat 6 on Windows

2008-09-22 Thread Brian Clark
Thanks again for all of our suggestions. The Eclipse Memory Analyzer Tool looks 
very interesting and helpful. It also calls out the JAVA_OPT  
-XX:+HeapDumpOnOutOfMemoryError to auto generate a heap dump for me. I was 
originally looking for a way to automatically generate a thread dump, but this 
will be extremely helpful as well. 

Another alternative to JHAT is Sun's new free tool, Visual VM. I think JHAT is 
part of its underlying technology. Visual VM now ships with Sun JDK 1.6.0_07 
and later, and is available via download separately from 
https://visualvm.dev.java.net/ 

I believe that VisualVM will eventually replace Sun's Jconsole, as it has all 
of Jconsole's functionality as well as heap dump, thread dump, and basic 
profiler functionality. It seems to have some of the functionality that is in 
Eclipse MAT. Not sure of the pro's and con's of one vs. the other though. I 
plan on looking at both. 

Thanks again,
Brian


- Original Message 
From: Surendrakumar Viswanathan -X (suviswan - HCL at Cisco) 
To: Surendrakumar Viswanathan -X (suviswan - HCL at Cisco)  Tomcat Users List 
users@tomcat.apache.org
Sent: Monday, September 22, 2008 4:56:05 AM
Subject: RE: jstack and Tomcat 6 on Windows

OOPS It's alternate to JHAT and not JMAP.

Suren 

 -Original Message-
 From: Surendrakumar Viswanathan -X (suviswan - HCL at Cisco) 
 Sent: Monday, September 22, 2008 3:25 PM
 To: 'Tomcat Users List'
 Subject: RE: jstack and Tomcat 6 on Windows
 
 Check Eclipse Memory Analyzer Tool www.eclipse.org/mat/. This 
 is alternate to JMAP, but it can parse the hprof file faster 
 and have a very visual GUI.
 
 Thanks
 Suren 
 
  -Original Message-
  From: Johnny Kewl [mailto:[EMAIL PROTECTED]
  Sent: Saturday, September 20, 2008 4:40 PM
  To: Tomcat Users List
  Subject: Re: jstack and Tomcat 6 on Windows
  
   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. ;-)
  
   
  
  OK... I couldnt resist giving it a little go... JHat is 
 exactly what 
  you looking for...
  http://weblogs.java.net/blog/jfarcand/archive/2006/02/using_mu
  stangs.html
  
  Well done Sun... its exactly what I've been looking for...
  
  Let the server run a little do a dump, run the server and then 
  from the browser to the HIST option...
  
  The highest non Sun class... webapp class... is going to be the bad 
  guy ;)
  
  Damn thats nice...
  
  --
  -
  HARBOR : http://www.kewlstuff.co.za/index.htm
  The most powerful application server on earth.
  The only real POJO Application Server.
  See it in Action : 
  http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm
  --


  

Re: jstack and Tomcat 6 on Windows

2008-09-22 Thread Johnny Kewl


- Original Message - 
From: Brian Clark [EMAIL PROTECTED]

To: Tomcat Users List users@tomcat.apache.org
Sent: Monday, September 22, 2008 6:11 PM
Subject: Re: jstack and Tomcat 6 on Windows


Thanks again for all of our suggestions. The Eclipse Memory Analyzer Tool 
looks very interesting and helpful. It also calls out the 
AVA_OPT  -XX:+HeapDumpOnOutOfMemoryError to auto generate a heap dump for 
me. I was originally looking for a way to automatically generate a thread 
dump, but this will be extremely helpful as well.


Another alternative to JHAT is Sun's new free tool, Visual VM. I think 
JHAT is part of its underlying technology. Visual VM now ships with Sun 
JDK 1.6.0_07 and later, and is available via download separately from 
https://visualvm.dev.java.net/


I believe that VisualVM will eventually replace Sun's Jconsole, as it has 
all of Jconsole's functionality as well as heap dump, thread dump, and 
basic profiler functionality. It seems to have some of the functionality 
that is in Eclipse MAT. Not sure of the pro's and con's of one vs. the 
other though. I plan on looking at both.


Thanks again,
Brian


VisualVM... damn its nice...

---
HARBOR : http://www.kewlstuff.co.za/index.htm
The most powerful application server on earth.
The only real POJO Application Server.
See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm
---


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



Re: jstack and Tomcat 6 on Windows

2008-09-20 Thread Johnny Kewl


- Original Message - 
From: Brian Clark [EMAIL PROTECTED]

To: Tomcat Users List users@tomcat.apache.org
Sent: Saturday, September 20, 2008 12:58 AM
Subject: Re: jstack and Tomcat 6 on Windows



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. 
;-)




Oh... I dont know if trying to find the issue on production server is going 
to be easy...

Out Of Mem ... scary start praying that it is, one of your apps...
Normally JMeter and a quiet system is the easiet way to find which one is 
the problem...


The later JDK's 6 do what you looking for... google for JHAT... here ...
http://java.sun.com/javase/6/docs/technotes/tools/share/jhat.html

Notice the HeapDumpOnOutOfMemoryError java option...

And also check out JMX, JConsole you may find all that useful... esp the 
force heap garbage collection option.


Another rough guide is runs the various web-apps thru the browser... and 
watch the window handles... not the memory...
If that keeps sliding up... thats the bad webapp... trouble with all the 
Java monitoring stuff is that unless a GC is done (at least twice), what you 
looking at doesnt mean much


I've never tried the JHat stuff... but they made it because OOM errors are a 
nightmare... let us know if JHat is the thing we all being waiting for ;)


Good Luck ;)

---
HARBOR : http://www.kewlstuff.co.za/index.htm
The most powerful application server on earth.
The only real POJO Application Server.
See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm
---





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



Re: jstack and Tomcat 6 on Windows

2008-09-20 Thread Johnny Kewl

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. ;-)





OK... I couldnt resist giving it a little go... JHat is exactly what you 
looking for...

http://weblogs.java.net/blog/jfarcand/archive/2006/02/using_mustangs.html

Well done Sun... its exactly what I've been looking for...

Let the server run a little do a dump, run the server and then from the 
browser to the HIST option...


The highest non Sun class... webapp class... is going to be the bad guy ;)

Damn thats nice...

---
HARBOR : http://www.kewlstuff.co.za/index.htm
The most powerful application server on earth.
The only real POJO Application Server.
See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm
--- 



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



jstack and Tomcat 6 on Windows

2008-09-19 Thread Brian Clark
Hello,

I run Tomcat 6.0.x as a service on Windows 2003, using Sun JDK 1.6. I was 
trying to use the jstack program, part of the JDK, to get a stack dump from 
Tomcat/Java on my server. However, I ran into a problem. First of all, Tomcat 
on Windows seems to hide the JVM instance. Java doesn't show up in my process 
listing. I tried running jstack against the  Tomcat PID but it errored out. 

Any idea how to make jstack work with Tomcat running as a service on Win2k3?

BTW:  I can get a stack dump using a tool like Sun's VisualVM, but I wanted to 
use jstack as part of a script, which I obviously can't do with VisualVM.

Thanks,
Brian



  

Re: jstack and Tomcat 6 on Windows

2008-09-19 Thread André Warnier

Brian Clark wrote:

Hello,

I run Tomcat 6.0.x as a service on Windows 2003, using Sun JDK 1.6. I was trying to use the jstack program, part of the JDK, to get a stack dump from Tomcat/Java on my server. However, I ran into a problem. First of all, Tomcat on Windows seems to hide the JVM instance. Java doesn't show up in my process listing. I tried running jstack against the  Tomcat PID but it errored out. 


Any idea how to make jstack work with Tomcat running as a service on Win2k3?


I can't answer your question, but a look here might provide a clue :
http://commons.apache.org/daemon/procrun.html

That seems to be the way in which Tomcat is now implemented under 
Windows. Versions prior to 5.5 used to have a structure similar to the 
Unix version, with startup.bat and catalina.bat invoking Tomcat via 
Java, but that seems to have changed nowadays.


Also, if it might help somewhat : open a command window and navigate to 
the Tomcat/bin directory. Then, instead of running tomcat as a service, 
just enter the tomcatx.exe command (where x is probably 6 in your 
case) (not the tomcatxW.exe). That will run Tomcat in the command 
window, maybe easier for you to figure out what is going on.

Not for me though.



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



Re: jstack and Tomcat 6 on Windows

2008-09-19 Thread André Warnier

André Warnier wrote:

Brian Clark wrote:

Hello,

I run Tomcat 6.0.x as a service on Windows 2003, using Sun JDK 1.6. I 
was trying to use the jstack program, part of the JDK, to get a stack 
dump from Tomcat/Java on my server. However, I ran into a problem. 
First of all, Tomcat on Windows seems to hide the JVM instance. Java 
doesn't show up in my process listing. I tried running jstack against 
the  Tomcat PID but it errored out.
Any idea how to make jstack work with Tomcat running as a service on 
Win2k3?



I can't answer your question, but a look here might provide a clue :
http://commons.apache.org/daemon/procrun.html

That seems to be the way in which Tomcat is now implemented under 
Windows. Versions prior to 5.5 used to have a structure similar to the 
Unix version, with startup.bat and catalina.bat invoking Tomcat via 
Java, but that seems to have changed nowadays.


Also, if it might help somewhat : open a command window and navigate to 
the Tomcat/bin directory. Then, instead of running tomcat as a service, 
just enter the tomcatx.exe command (where x is probably 6 in your 
case) (not the tomcatxW.exe). That will run Tomcat in the command 
window, maybe easier for you to figure out what is going on.

Not for me though.



Addendum :
I just had another look at the Tomcat site. For version 5.5, there are 2 
downloads for Windows : one is a zip, the other an msi installer.

I must have in the past downloaded and installed the msi.
I downloaded the zip version now, and that one seems to contain the 
usual startup.bat and catalina.bat files, in addition to the Win32 
tomcat5 and tomcat5W executables.
Maybe the .bat files allow to start Tomcat in the traditional way, via 
Java etc.. ?




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



RE: jstack and Tomcat 6 on Windows

2008-09-19 Thread Martin Gainty

I would steer clear of any windowsInstaller messWithYourRegistry windows 
specific utilities and/or programs

SET JAVA_HOME=SourceFolderLocationWhereJavaIsInstalled
SET CATALINA_HOME=SourceFolderLocationWhereTomcatIsInstalled
SET JAVA_OPTS=whatever java options you need to set
then
java -jar bootstrap.jar works on every platform 

Martin 
__ 
Disclaimer and confidentiality note 
Everything in this e-mail and any attachments relates to the official business 
of Sender. This transmission is of a confidential nature and Sender does not 
endorse distribution to any party other than intended recipient. Sender does 
not necessarily endorse content contained within this transmission. 


 Date: Fri, 19 Sep 2008 23:42:42 +0200
 From: [EMAIL PROTECTED]
 To: users@tomcat.apache.org
 Subject: Re: jstack and Tomcat 6 on Windows
 
 André Warnier wrote:
  Brian Clark wrote:
  Hello,
 
  I run Tomcat 6.0.x as a service on Windows 2003, using Sun JDK 1.6. I 
  was trying to use the jstack program, part of the JDK, to get a stack 
  dump from Tomcat/Java on my server. However, I ran into a problem. 
  First of all, Tomcat on Windows seems to hide the JVM instance. Java 
  doesn't show up in my process listing. I tried running jstack against 
  the  Tomcat PID but it errored out.
  Any idea how to make jstack work with Tomcat running as a service on 
  Win2k3?
 
  I can't answer your question, but a look here might provide a clue :
  http://commons.apache.org/daemon/procrun.html
  
  That seems to be the way in which Tomcat is now implemented under 
  Windows. Versions prior to 5.5 used to have a structure similar to the 
  Unix version, with startup.bat and catalina.bat invoking Tomcat via 
  Java, but that seems to have changed nowadays.
  
  Also, if it might help somewhat : open a command window and navigate to 
  the Tomcat/bin directory. Then, instead of running tomcat as a service, 
  just enter the tomcatx.exe command (where x is probably 6 in your 
  case) (not the tomcatxW.exe). That will run Tomcat in the command 
  window, maybe easier for you to figure out what is going on.
  Not for me though.
  
 
 Addendum :
 I just had another look at the Tomcat site. For version 5.5, there are 2 
 downloads for Windows : one is a zip, the other an msi installer.
 I must have in the past downloaded and installed the msi.
 I downloaded the zip version now, and that one seems to contain the 
 usual startup.bat and catalina.bat files, in addition to the Win32 
 tomcat5 and tomcat5W executables.
 Maybe the .bat files allow to start Tomcat in the traditional way, via 
 Java etc.. ?
 
 
 
 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 

_
See how Windows connects the people, information, and fun that are part of your 
life.
http://clk.atdmt.com/MRT/go/msnnkwxp1020093175mrt/direct/01/

Re: jstack and Tomcat 6 on Windows

2008-09-19 Thread Johnny Kewl


- Original Message - 
From: André Warnier [EMAIL PROTECTED]

To: Tomcat Users List users@tomcat.apache.org
Sent: Friday, September 19, 2008 11:42 PM
Subject: Re: jstack and Tomcat 6 on Windows



André Warnier wrote:

Brian Clark wrote:

Hello,

I run Tomcat 6.0.x as a service on Windows 2003, using Sun JDK 1.6. I 
was trying to use the jstack program, part of the JDK, to get a stack 
dump from Tomcat/Java on my server. However, I ran into a problem. First 
of all, Tomcat on Windows seems to hide the JVM instance. Java doesn't 
show up in my process listing. I tried running jstack against the 
Tomcat PID but it errored out.
Any idea how to make jstack work with Tomcat running as a service on 
Win2k3?



I can't answer your question, but a look here might provide a clue :
http://commons.apache.org/daemon/procrun.html

That seems to be the way in which Tomcat is now implemented under 
Windows. Versions prior to 5.5 used to have a structure similar to the 
Unix version, with startup.bat and catalina.bat invoking Tomcat via Java, 
but that seems to have changed nowadays.


Also, if it might help somewhat : open a command window and navigate to 
the Tomcat/bin directory. Then, instead of running tomcat as a service, 
just enter the tomcatx.exe command (where x is probably 6 in your case) 
(not the tomcatxW.exe). That will run Tomcat in the command window, maybe 
easier for you to figure out what is going on.

Not for me though.



Addendum :
I just had another look at the Tomcat site. For version 5.5, there are 2 
downloads for Windows : one is a zip, the other an msi installer.

I must have in the past downloaded and installed the msi.
I downloaded the zip version now, and that one seems to contain the usual 
startup.bat and catalina.bat files, in addition to the Win32 tomcat5 and 
tomcat5W executables.
Maybe the .bat files allow to start Tomcat in the traditional way, via 
Java etc.. ?



As a Service the PID is TomcatX

From the start.BAT its JAVA


The easiest way to get the PID is to type
netstat -noa
Its the one next to the port you on...

On windows... you install your service version EXE
Then you download the zip version and copy the missing BIN scripts across... 
then you have all the files


If you need thread dumps

Start TC from the BAT file.
When you need a dump... press ctrl + break from term window... easier than 
Jstack...


Andre is right. as a service Tomcat appears under the non normal java... 
because its started from a windows service... not launched as a normal java 
process.


---
HARBOR : http://www.kewlstuff.co.za/index.htm
The most powerful application server on earth.
The only real POJO Application Server.
See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm
---










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



Re: jstack and Tomcat 6 on Windows

2008-09-19 Thread André Warnier

Martin Gainty wrote:

I would steer clear of any windowsInstaller messWithYourRegistry windows 
specific utilities and/or programs

SET JAVA_HOME=SourceFolderLocationWhereJavaIsInstalled
SET CATALINA_HOME=SourceFolderLocationWhereTomcatIsInstalled
SET JAVA_OPTS=whatever java options you need to set
then
java -jar bootstrap.jar works on every platform 



Oh, I didn't think of that !
And what happens when you log out of your Windows server ? :-)



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



Re: jstack and Tomcat 6 on Windows

2008-09-19 Thread Brian Clark
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.  ;-)

- Original Message 

From: Johnny Kewl [EMAIL PROTECTED]

If you need thread dumps

Start TC from the BAT file.
When you need a dump... press ctrl + break from term window... easier than 
Jstack...


  

Re: jstack and Tomcat 6 on Windows

2008-09-19 Thread André Warnier

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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]