Re: After stopping tomcat, the tomcat process still appears to be running

2006-10-18 Thread Jørgen Nørgaard
Hello,


If your servlet(s) start new threads that run independently of request
this may happen.

Could this be the case?

On Wed, October 18, 2006 01:42, Elaine TING wrote:
 Hi,

 This is what I have done:

 1) use shutdown.sh to shut down tomcat
 2) Now the website appears to be down
 3) Use ps -ef | grep tomcat to check the processes, tomcat still appears
 to be running:
 ps -ef | grep tomcat
 root 21892 1  1 14:30 pts/21   00:00:17 /local/Java/bin/java
 -Djava.endorsed.dirs=/opt/jakarta-tomcat/common/endorsed -classpath
 /local/Java/lib/tools.jar:/opt/jakarta-tomcat/bin/bootstrap.jar:/opt/jak
 arta-tomcat/bin/commons-logging-api.jar
 -Dcatalina.base=/opt/jakarta-tomcat -Dcatalina.home=/opt/jakarta-tomcat
 -Djava.io.tmpdir=/opt/jakarta-tomcat/temp
 org.apache.catalina.startup.Bootstrap start
 4) use startup.sh to start tomcat
 5) website appears to be up and running again
 6) check the processes, now there are 2 tomcats running:

 ps -ef | grep tomcat
 root 21892 1  1 14:30 pts/21   00:00:17 /local/Java/bin/java
 -Djava.endorsed.dirs=/opt/jakarta-tomcat/common/endorsed -classpath
 /local/Java/lib/tools.jar:/opt/jakarta-tomcat/bin/bootstrap.jar:/opt/jak
 arta-tomcat/bin/commons-logging-api.jar
 -Dcatalina.base=/opt/jakarta-tomcat -Dcatalina.home=/opt/jakarta-tomcat
 -Djava.io.tmpdir=/opt/jakarta-tomcat/temp
 org.apache.catalina.startup.Bootstrap start
 root 22108 1  1 14:33 pts/21   00:00:19 /local/Java/bin/java
 -Djava.endorsed.dirs=/opt/jakarta-tomcat/common/endorsed -classpath
 /local/Java/lib/tools.jar:/opt/jakarta-tomcat/bin/bootstrap.jar:/opt/jak
 arta-tomcat/bin/commons-logging-api.jar
 -Dcatalina.base=/opt/jakarta-tomcat -Dcatalina.home=/opt/jakarta-tomcat
 -Djava.io.tmpdir=/opt/jakarta-tomcat/temp
 org.apache.catalina.startup.Bootstrap start
 ops  22427 10618  0 14:52 pts/21   00:00:00 grep tomcat

 Why was shutdown.sh unable to kill the tomcat process? I'm running
 Tomcat 5.0.28 on SUSE LINUX Enterprise Server 9. Java version: 1.5.0_03.

 Thank you in advance,
 Elaine




-- 
/jørgen nørgaard
e-mail: [EMAIL PROTECTED] | Phone: +45 2627 3769
http://anneli.dk/~jnp/
 |\  _,,,---,,_
 /,`.-'`'-.  ;-;;,_
 |,4-  ) )-,_. ,\ (  `'-'
'---''(_/--'  `-'\_)



-
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: After stopping tomcat, the tomcat process still appears to be running

2006-10-18 Thread Tomas Hulek
At JVM shutdown, the JVM is terminated only if all remaining running
threads are daemon threads.

Therefore, if the application starts own threads, it is necessary to ensure
that

1) either all these threads are destroyed before JVM shutdown by calling
the stop() method for each of the threads,

2) or make them daemon threads by calling setDaemon() right after thread
creation.


Tomas


   
 Jørgen Nørgaard   
 [EMAIL PROTECTED]   
To
 18.10.2006 10:02  Tomcat Users List 
   users@tomcat.apache.org   
cc
 Please respond to 
   Tomcat Users   Subject
   List   Re: After stopping tomcat,  the
 [EMAIL PROTECTED] tomcat process still appears to be
 che.org  running 
   
   
   
   
   
   




Hello,


If your servlet(s) start new threads that run independently of request
this may happen.

Could this be the case?

On Wed, October 18, 2006 01:42, Elaine TING wrote:
 Hi,

 This is what I have done:

 1) use shutdown.sh to shut down tomcat
 2) Now the website appears to be down
 3) Use ps -ef | grep tomcat to check the processes, tomcat still appears
 to be running:
 ps -ef | grep tomcat
 root 21892 1  1 14:30 pts/21   00:00:17 /local/Java/bin/java
 -Djava.endorsed.dirs=/opt/jakarta-tomcat/common/endorsed -classpath
 /local/Java/lib/tools.jar:/opt/jakarta-tomcat/bin/bootstrap.jar:/opt/jak
 arta-tomcat/bin/commons-logging-api.jar
 -Dcatalina.base=/opt/jakarta-tomcat -Dcatalina.home=/opt/jakarta-tomcat
 -Djava.io.tmpdir=/opt/jakarta-tomcat/temp
 org.apache.catalina.startup.Bootstrap start
 4) use startup.sh to start tomcat
 5) website appears to be up and running again
 6) check the processes, now there are 2 tomcats running:

 ps -ef | grep tomcat
 root 21892 1  1 14:30 pts/21   00:00:17 /local/Java/bin/java
 -Djava.endorsed.dirs=/opt/jakarta-tomcat/common/endorsed -classpath
 /local/Java/lib/tools.jar:/opt/jakarta-tomcat/bin/bootstrap.jar:/opt/jak
 arta-tomcat/bin/commons-logging-api.jar
 -Dcatalina.base=/opt/jakarta-tomcat -Dcatalina.home=/opt/jakarta-tomcat
 -Djava.io.tmpdir=/opt/jakarta-tomcat/temp
 org.apache.catalina.startup.Bootstrap start
 root 22108 1  1 14:33 pts/21   00:00:19 /local/Java/bin/java
 -Djava.endorsed.dirs=/opt/jakarta-tomcat/common/endorsed -classpath
 /local/Java/lib/tools.jar:/opt/jakarta-tomcat/bin/bootstrap.jar:/opt/jak
 arta-tomcat/bin/commons-logging-api.jar
 -Dcatalina.base=/opt/jakarta-tomcat -Dcatalina.home=/opt/jakarta-tomcat
 -Djava.io.tmpdir=/opt/jakarta-tomcat/temp
 org.apache.catalina.startup.Bootstrap start
 ops  22427 10618  0 14:52 pts/21   00:00:00 grep tomcat

 Why was shutdown.sh unable to kill the tomcat process? I'm running
 Tomcat 5.0.28 on SUSE LINUX Enterprise Server 9. Java version: 1.5.0_03.

 Thank you in advance,
 Elaine




--
/jørgen nørgaard
e-mail: [EMAIL PROTECTED] | Phone: +45 2627 3769
http://anneli.dk/~jnp/
 |\  _,,,---,,_
 /,`.-'`'-.  ;-;;,_
 |,4-  ) )-,_. ,\ (  `'-'
'---''(_/--'  `-'\_)



-
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: After stopping tomcat, the tomcat process still appears to be running

2006-10-18 Thread Christopher Schultz
Tomas,

 At JVM shutdown, the JVM is terminated only if all remaining running
 threads are daemon threads.

Not true. System.exit() kills the VM regardless of the presence of
non-daemon threads.

-chris




signature.asc
Description: OpenPGP digital signature


Re: After stopping tomcat, the tomcat process still appears to be running

2006-10-18 Thread David Smith
To the best of my knowlege, System.exit() is never called from within 
tomcat.  Tomcat closes it's own daemon threads and then exits normally 
like any other java program.  If a third party package starts it's own 
thread, that package is responsible for cleaning up what it starts.  
Tomcat won't exit until the threads are properly cleaned up.


--David

Tomas Hulek wrote:


AFAIK Tomcat does not call System.exit() - at least did not in version
4.1.*, when we solved the very same problem.

T.



  
Christopher   
Schultz   
[EMAIL PROTECTED]  To 
rschultz.net Tomcat Users List   
  users@tomcat.apache.org   
18.10.2006 14:36   cc 
  
  Subject 
Please respond to Re: After stopping tomcat,  the 
  Tomcat Users   tomcat process still appears to be  
  List   running 
[EMAIL PROTECTED] 
che.org  
  
  
  
  





Tomas,

 


At JVM shutdown, the JVM is terminated only if all remaining running
threads are daemon threads.
   



Not true. System.exit() kills the VM regardless of the presence of
non-daemon threads.

-chris


(See attached file: signature.asc)
 




-
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: After stopping tomcat, the tomcat process still appears to be running

2006-10-18 Thread Tomas Hulek
AFAIK Tomcat does not call System.exit() - at least did not in version
4.1.*, when we solved the very same problem.

T.



   
 Christopher   
 Schultz   
 [EMAIL PROTECTED]  To 
 rschultz.net Tomcat Users List   
   users@tomcat.apache.org   
 18.10.2006 14:36   cc 
   
   Subject 
 Please respond to Re: After stopping tomcat,  the 
   Tomcat Users   tomcat process still appears to be  
   List   running 
 [EMAIL PROTECTED] 
 che.org  
   
   
   
   




Tomas,

 At JVM shutdown, the JVM is terminated only if all remaining running
 threads are daemon threads.

Not true. System.exit() kills the VM regardless of the presence of
non-daemon threads.

-chris


(See attached file: signature.asc)
-
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: After stopping tomcat, the tomcat process still appears to be running

2006-10-18 Thread Jon Wingfield
You've also got other candidates such as database connections, JMS 
connections etc which could spawn threads (For example, for keep-alive 
functionality).


The easiest thing to do is a thread dump (send the process a SIGQUIT 
signal) after stopping tomcat to see which thread(s) are keeping the JVM 
up. Once identified you need to fix your code.


HTH,

Jon

Tomas Hulek wrote:

At JVM shutdown, the JVM is terminated only if all remaining running
threads are daemon threads.

Therefore, if the application starts own threads, it is necessary to ensure
that

1) either all these threads are destroyed before JVM shutdown by calling
the stop() method for each of the threads,

2) or make them daemon threads by calling setDaemon() right after thread
creation.


Tomas


   
 Jørgen Nørgaard   
 [EMAIL PROTECTED]   
To 
 18.10.2006 10:02  Tomcat Users List 
   users@tomcat.apache.org   
cc 
 Please respond to 
   Tomcat Users   Subject 
   List   Re: After stopping tomcat,  the 
 [EMAIL PROTECTED] tomcat process still appears to be  
 che.org  running 
   
   
   
   
   
   





Hello,


If your servlet(s) start new threads that run independently of request
this may happen.

Could this be the case?

On Wed, October 18, 2006 01:42, Elaine TING wrote:

Hi,

This is what I have done:

1) use shutdown.sh to shut down tomcat
2) Now the website appears to be down
3) Use ps -ef | grep tomcat to check the processes, tomcat still appears
to be running:

ps -ef | grep tomcat

root 21892 1  1 14:30 pts/21   00:00:17 /local/Java/bin/java
-Djava.endorsed.dirs=/opt/jakarta-tomcat/common/endorsed -classpath
/local/Java/lib/tools.jar:/opt/jakarta-tomcat/bin/bootstrap.jar:/opt/jak
arta-tomcat/bin/commons-logging-api.jar
-Dcatalina.base=/opt/jakarta-tomcat -Dcatalina.home=/opt/jakarta-tomcat
-Djava.io.tmpdir=/opt/jakarta-tomcat/temp
org.apache.catalina.startup.Bootstrap start
4) use startup.sh to start tomcat
5) website appears to be up and running again
6) check the processes, now there are 2 tomcats running:


ps -ef | grep tomcat

root 21892 1  1 14:30 pts/21   00:00:17 /local/Java/bin/java
-Djava.endorsed.dirs=/opt/jakarta-tomcat/common/endorsed -classpath
/local/Java/lib/tools.jar:/opt/jakarta-tomcat/bin/bootstrap.jar:/opt/jak
arta-tomcat/bin/commons-logging-api.jar
-Dcatalina.base=/opt/jakarta-tomcat -Dcatalina.home=/opt/jakarta-tomcat
-Djava.io.tmpdir=/opt/jakarta-tomcat/temp
org.apache.catalina.startup.Bootstrap start
root 22108 1  1 14:33 pts/21   00:00:19 /local/Java/bin/java
-Djava.endorsed.dirs=/opt/jakarta-tomcat/common/endorsed -classpath
/local/Java/lib/tools.jar:/opt/jakarta-tomcat/bin/bootstrap.jar:/opt/jak
arta-tomcat/bin/commons-logging-api.jar
-Dcatalina.base=/opt/jakarta-tomcat -Dcatalina.home=/opt/jakarta-tomcat
-Djava.io.tmpdir=/opt/jakarta-tomcat/temp
org.apache.catalina.startup.Bootstrap start
ops  22427 10618  0 14:52 pts/21   00:00:00 grep tomcat

Why was shutdown.sh unable to kill the tomcat process? I'm running
Tomcat 5.0.28 on SUSE LINUX Enterprise Server 9. Java version: 1.5.0_03.

Thank you in advance,
Elaine





--
/jørgen nørgaard
e-mail: [EMAIL PROTECTED] | Phone: +45 2627 3769
http://anneli.dk/~jnp/
 |\  _,,,---,,_
 /,`.-'`'-.  ;-;;,_
 |,4-  ) )-,_. ,\ (  `'-'
'---''(_/--'  `-'\_)



-
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: After stopping tomcat, the tomcat process still appears to be running

2006-10-18 Thread Christopher Schultz
Tomas,

To be fair, you did say JVM shutdown, not Tomcat shutdown.

 AFAIK Tomcat does not call System.exit() - at least did not in version
 4.1.*, when we solved the very same problem.

Here:

 At JVM shutdown, the JVM is terminated only if all remaining running
 threads are daemon threads.
 
 Not true. System.exit() kills the VM regardless of the presence of
 non-daemon threads.




signature.asc
Description: OpenPGP digital signature


Re: After stopping tomcat, the tomcat process still appears to be running

2006-10-17 Thread Christopher Schultz
Elaine,

 1) use shutdown.sh to shut down tomcat
 2) Now the website appears to be down
 3) Use ps -ef | grep tomcat to check the processes, tomcat still appears
 to be running:

I suspect that you are seeing another Tomcat process that is either left
over from a previous configuration (say, you changed the port numbers at
some point before you shut the old one down), or from an entirely
different app environment (which would be odd since the paths look the
same).

At any rate, you could probably just kill -9 the lingering process,
re-start Tomcat, and check to make sure that everything still works as
expected. It's probably nothing to worry about.

If it comes back, though, it's time to start looking around for other
ways that Tomcat is being started on your server.

-chris




signature.asc
Description: OpenPGP digital signature