Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Apache Tomcat »

Re: Trouble with java.util.Timer in Tomcat 5.5

Ronald Klop

2007-07-02

Replies:

Could it be the Timer is waiting for a previous action to finish? Maybe the FTP connect 'hangs'.

Ronald.



On Fri Jun 29 16:41:13 CEST 2007 Tomcat Users List <users@(protected):
> I have an app running in Tomcat 5.5.12, with jre 1.5.0_12 (explicitly
> specified in the service configuration), on windows 2000 server.
>
> I have one class that is initialized by a servletContextListener, in the
> contextInitialized event. This class uses java.util.Timer and
> java.util.TimerTask to check every few minutes for new files on an ftp
> site, and if it finds any, it downloads and processes them. This all
> works fine for anywhere from 2 or 3 days to a week or so, then the timer
> just stops firing, and indicated by a sudden lack of entries in the log
> file (I log every time the timer fires to help track down this problem).
>
> Over the last couple of weeks, I've found some things that can cause
> this, but I believe I've fixed them, but my timer still stops firing
> after a few days. The things I've already fixed were updating the jre
> to 1.5.12, because of problems with automatic time correction on the
> server, and I found that unhandled exceptions in the timer task can also
> cause this, so early last week I modified my code to trap all exceptions
> before they can trickle up to the timer, and log them, and I don't see
> any exceptions being logged.
>
> It doesn't seem to be related to the number of executions, because the
> latest time it stopped on me, it had fired around 1200 times, and the
> time before that was around 4500 times. It can also be any time of day,
> and sometimes the server is busy and other times it hasn't had a
> connection for several hours.
>
> Any other suggestions as to what I should look for to find this?
>
> Thanks!
> D
>
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@(protected)
> To unsubscribe, e-mail: users-unsubscribe@(protected)
> For additional commands, e-mail: users-help@(protected)
>
©2008 junlu.com - Jax Systems, LLC, U.S.A.