You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Mark <se...@yahoo.com> on 2005/03/15 16:31:51 UTC

running a thread in Tomcat

Hi,
I'm starting a new thread in my init servlet(I know it has been
discussed few time, that it's not the best idea, but anyway)
 and everyhing is fine untill I need to restart tomcat.
When I shutdown (shutdown.sh) Tomcat the java process remain active.

The question is it expected? or I need to take care about this thread
in destroy() method of my init servlet?

I have tomcat 5.0.24 on RH9.

Thanks a lot,
Mark.



		
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - Find what you need with new enhanced search. 
http://info.mail.yahoo.com/mail_250

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: running a thread in Tomcat

Posted by Ben Souther <bs...@fwdco.com>.
set isDaemon(true) for all your threads.


On Tue, 2005-03-15 at 10:31, Mark wrote:
> Hi,
> I'm starting a new thread in my init servlet(I know it has been
> discussed few time, that it's not the best idea, but anyway)
>  and everyhing is fine untill I need to restart tomcat.
> When I shutdown (shutdown.sh) Tomcat the java process remain active.
> 
> The question is it expected? or I need to take care about this thread
> in destroy() method of my init servlet?
> 
> I have tomcat 5.0.24 on RH9.
> 
> Thanks a lot,
> Mark.
> 
> 
> 
> 		
> __________________________________ 
> Do you Yahoo!? 
> Yahoo! Mail - Find what you need with new enhanced search. 
> http://info.mail.yahoo.com/mail_250
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: running a thread in Tomcat

Posted by Viorel Dragomir <vd...@wylog.com>.
I apologize for the previous post.
The Read Receipt was enabled [because of my boss's will] and I forgot about it.


Thank you for your understanding,


Viorel Dragomir

.
..
-------------------------------------------------------------------



----- Original Message ----- 
From: Mark 
To: tomcat-user@jakarta.apache.org 
Sent: Tuesday, March 15, 2005 17:31
Subject: running a thread in Tomcat


Hi,
I'm starting a new thread in my init servlet(I know it has been
discussed few time, that it's not the best idea, but anyway)
 and everyhing is fine untill I need to restart tomcat.
When I shutdown (shutdown.sh) Tomcat the java process remain active.

The question is it expected? or I need to take care about this thread
in destroy() method of my init servlet?

I have tomcat 5.0.24 on RH9.

Thanks a lot,
Mark.




__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - Find what you need with new enhanced search. 
http://info.mail.yahoo.com/mail_250

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org

Re: running a thread in Tomcat

Posted by Darek Czarkowski <dc...@infinitesource.ca>.
you have to terminate that thread explicitly. You can do that by
defining ApplicationServletContextListener and have it stopped on
contextDestroyed event

DarekC

On Tue, 2005-03-15 at 07:31, Mark wrote:
> Hi,
> I'm starting a new thread in my init servlet(I know it has been
> discussed few time, that it's not the best idea, but anyway)
>  and everyhing is fine untill I need to restart tomcat.
> When I shutdown (shutdown.sh) Tomcat the java process remain active.
> 
> The question is it expected? or I need to take care about this thread
> in destroy() method of my init servlet?
> 
> I have tomcat 5.0.24 on RH9.
> 
> Thanks a lot,
> Mark.
> 
> 
> 
> 		
> __________________________________ 
> Do you Yahoo!? 
> Yahoo! Mail - Find what you need with new enhanced search. 
> http://info.mail.yahoo.com/mail_250
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: running a thread in Tomcat

Posted by Viorel Dragomir <vd...@wylog.com>.

Set the thread to act like a daemon.
It's a Thread [class] thing. 

There are ten better ways to resolve the same problem without threads.



Viorel Dragomir

.
..
-------------------------------------------------------------------



----- Original Message ----- 
From: Mark 
To: tomcat-user@jakarta.apache.org 
Sent: Tuesday, March 15, 2005 17:31
Subject: running a thread in Tomcat


Hi,
I'm starting a new thread in my init servlet(I know it has been
discussed few time, that it's not the best idea, but anyway)
 and everyhing is fine untill I need to restart tomcat.
When I shutdown (shutdown.sh) Tomcat the java process remain active.

The question is it expected? or I need to take care about this thread
in destroy() method of my init servlet?

I have tomcat 5.0.24 on RH9.

Thanks a lot,
Mark.




__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - Find what you need with new enhanced search. 
http://info.mail.yahoo.com/mail_250

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org