tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "gautam" <>
Subject Using Non-Servlet Timers (Was - I need to run a servlet periodically)
Date Thu, 10 Oct 2002 03:53:29 GMT

We are using java.util.Timer objects to periodically run through a few
object caches and get rid of stale items. Everything works fine. However, I
can no longer stop Tomcat using the "Catalina.bat stop" command. I suspect
that the Timer objects are still alive and are the cause of the problem. Any
ideas on how to fix this ?

The objects we schedule via the timers are not Servlets. They are plain
vanilla Java classes.


Gautam Satpathy

-----Original Message-----
From: Rick Fincher []
Sent: Thursday, October 10, 2002 12:01 AM
To: Tomcat Users List
Subject: Re: I need to run a servlet periodically

Hi Filip,

Your servlet can call a class (doesn't have to be a servlet) that sets up a
java.util.timer to run your code as a timerTask.  The servlet can get
parameters from the web.xml file (like how often to execute) and pass that
to your class that controls the timer.

The servlet can pass your class the connection pool info and other needed
session info.


----- Original Message -----
From: "Cato, Christopher" <>
To: <>
Sent: Wednesday, October 09, 2002 9:04 AM
Subject: SV: I need to run a servlet periodically

> What you really need to do is to design your periodical servlet to
> Runnable. Add another servlet that starts the periodical servlet and load
> that servlet during startup. The periodical then does its thing and sleeps
> for x amount of time. Then wakes up and so on...
> /Christopher
> -----Ursprungligt meddelande-----
> Fran: Raj Saini
> Till: Tomcat Users List
> Skickat: 2002-10-07 23:24
> Amne: Re: I need to run a servlet periodically
> To need the servlet run periodically you need a client calling the
> servlet periodically. Make your client to run periodically and it will
> cause the servlet to run.
> We can suggest you a solution if you let us know what exactly you want
> your servlet to do.
> Raj Saini
> Filip Rachunek wrote:
> > Hello,
> > is it possible to have a servlet in Tomcat container
> > which is invoked automatically each gived time period?
> > [e.g. each 10 minutes]  And I would also need this
> > special servlet to access other resources of my web
> > application [connection pool, ...].
> >
> > Thanks.
> > Filip Rachunek
> >
> >

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

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

View raw message