Re: Tomcat, Timer and TimerTask question

2006-07-20 Thread Cameron
Thank you for all the responses. I had worked out that it is not loaded or called hence does not run. I embedded the same code to a servlet and it worked fine but in order to schedule this I will use the load it when the server starts. Many thanks for all your suggestions. Cameron ---

Re: Tomcat, Timer and TimerTask question

2006-07-20 Thread Christopher Schultz
Cameron, > Just trying to schedule a batch email run using Timer and TimerTask framework > on > Tomcat 4.1.31 You might also consider simply using a cron job (or win32 equivalent) for "real" batch jobs, instead of having your app server manage your batch jobs. -chris signature.asc Descripti

Re: Tomcat, Timer and TimerTask question

2006-07-20 Thread Jon Wingfield
It's not running because you schedule the task and then immediately cancel it. The scheduleAtFixedRate call doesn't block. Cameron wrote: Hello Just trying to schedule a batch email run using Timer and TimerTask framework on Tomcat 4.1.31 Found the following example from http://www.javapracti

RE: Re: Tomcat, Timer and TimerTask question

2006-07-20 Thread sfbell
A better possible solution might be to create a servlet that will execute the timer task for you. In order to do that, several steps need to be taken. 1. The servlet init() method needs to be used to create the thread for your task. 2. The servlet needs to be loaded on startup. In web.xml you wo

Re: Tomcat, Timer and TimerTask question

2006-07-20 Thread Vinu Varghese
Hi, What is the main for ? , Once u have main , why u need tomcat to run this ? Pls let me know how u are running this ? Cheers Vinu Cameron wrote: Hello Just trying to schedule a batch email run using Timer and TimerTask framework on Tomcat 4.1.31 Found the following example from http://

Tomcat, Timer and TimerTask question

2006-07-19 Thread Cameron
Hello Just trying to schedule a batch email run using Timer and TimerTask framework on Tomcat 4.1.31 Found the following example from http://www.javapractices.com/Topic54.cjp Trying trying to test this scheduling mechanism first just by printing to System.out first... (see below) It does not s