You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Chintan Shah <cv...@lucent.com> on 2001/11/07 10:05:54 UTC

Running Scheduled Task in Tomcat

Hi All,

I am using Win NT 4.0, Tomcat 3.2.1, Java 1.3 for my intranet based application (using jsp-javabeans-jdbc-db architecture). I want to set an automatic task (execution of a jsp page) in tomcat, which will be executed on scheduled time.

For example, everyday at 1:00 a.m. the jsp (java) code should be executed automatically, which (for example) may be firing a query onto database and getting a list of records, and sending some mails on particular criteria.

How can I do this ? (I don't want to set Windows Scheduler Tasks, which can execute a jsp page by opening a new browser window (at scheduled time) with that page and after some seconds, it will automatically close the browser window.)

any help is highly appreciated,

thanks in advance,
Chintan
---------------------------------------------------------------------------
This message has been posted through the Jakarta Tomcat 3.3 F.A.Q.
on line forum, and can be seen at:
<http://nagoya.apache.org:8080/jive/thread.jsp?forum=3&thread=23>
For more informations about the on-line Jakarta forums, please go to:
<http://nagoya.apache.org:8080/jive/>
---------------------------------------------------------------------------

--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: Running Scheduled Task in Tomcat

Posted by Alexis LESAGE <al...@atosorigin.com>.
Alternatively, write a small java Application which opens a URLConnection
to your JSP page URI and run the Application from a Cron (or MS-Scheduler)
The App can be on local or remote computer.

Al

----- Original Message -----
From: "Denis Balazuc" <de...@trader.com>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Wednesday, November 07, 2001 4:00 PM
Subject: Re: Running Scheduled Task in Tomcat


> I have exactly the same kind of process in place within Tomcat.
> I don't think Tomcat has any module to ease this so here's what I've done
:
>
> I have created a webapp (without any page) capable of running abstract
Task
> classes using a TaskRunner servlet
> The TaskRunner servlet knows from its configuration (in web.xml) what task
> class to load/run as well as how to connect to mail servers and databases.
> When a task is created, the TaskRunner servlet configuration is forwarded
to
> each created task before the task is started so that each task can have
its
> configuration stored within web.xml.
> Tasks can be started/stopped and logs viewed using the servlet (by
> requesting some URL with some parameters)
>
> This way, you have running process within Tomcat that can do whatever you
> want (including requesting a JSP page).
> Please send me an e-mail if you're interested in the tasks/servlet code
that
> I use.
>
> Hope this helps
> Denis
>
>
> ----- Original Message -----
> From: "Chintan Shah" <cv...@lucent.com>
> To: <to...@jakarta.apache.org>
> Sent: Wednesday, November 07, 2001 04:03 AM
> Subject: Running Scheduled Task in Tomcat
>
>
> > Hi All,
> >
> > I am using Win NT 4.0, Tomcat 3.2.1, Java 1.3 for my intranet based
> application (using jsp-javabeans-jdbc-db architecture). I want to set an
> automatic task (execution of a jsp page) in tomcat, which will be executed
> on scheduled time.
> >
> > For example, everyday at 1:00 a.m. the jsp (java) code should be
executed
> automatically, which (for example) may be firing a query onto database and
> getting a list of records, and sending some mails on particular criteria.
> >
> > How can I do this ? (I don't want to set Windows Scheduler Tasks, which
> can execute a jsp page by opening a new browser window (at scheduled time)
> with that page and after some seconds, it will automatically close the
> browser window.)
> >
> > any help is highly appreciated,
> >
> > thanks in advance,
> > Chintan
>
>
>
> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: Running Scheduled Task in Tomcat

Posted by Denis Balazuc <de...@trader.com>.
I have exactly the same kind of process in place within Tomcat.
I don't think Tomcat has any module to ease this so here's what I've done :

I have created a webapp (without any page) capable of running abstract Task
classes using a TaskRunner servlet
The TaskRunner servlet knows from its configuration (in web.xml) what task
class to load/run as well as how to connect to mail servers and databases.
When a task is created, the TaskRunner servlet configuration is forwarded to
each created task before the task is started so that each task can have its
configuration stored within web.xml.
Tasks can be started/stopped and logs viewed using the servlet (by
requesting some URL with some parameters)

This way, you have running process within Tomcat that can do whatever you
want (including requesting a JSP page).
Please send me an e-mail if you're interested in the tasks/servlet code that
I use.

Hope this helps
Denis


----- Original Message -----
From: "Chintan Shah" <cv...@lucent.com>
To: <to...@jakarta.apache.org>
Sent: Wednesday, November 07, 2001 04:03 AM
Subject: Running Scheduled Task in Tomcat


> Hi All,
>
> I am using Win NT 4.0, Tomcat 3.2.1, Java 1.3 for my intranet based
application (using jsp-javabeans-jdbc-db architecture). I want to set an
automatic task (execution of a jsp page) in tomcat, which will be executed
on scheduled time.
>
> For example, everyday at 1:00 a.m. the jsp (java) code should be executed
automatically, which (for example) may be firing a query onto database and
getting a list of records, and sending some mails on particular criteria.
>
> How can I do this ? (I don't want to set Windows Scheduler Tasks, which
can execute a jsp page by opening a new browser window (at scheduled time)
with that page and after some seconds, it will automatically close the
browser window.)
>
> any help is highly appreciated,
>
> thanks in advance,
> Chintan



--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>