jQuery in Action, 2nd edition*
The moose likes Tomcat and the fly likes Kick-off Java pgm when tomcat starts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Kick-off Java pgm when tomcat starts" Watch "Kick-off Java pgm when tomcat starts" New topic

Kick-off Java pgm when tomcat starts

Morrison Julia

Joined: Sep 04, 2006
Posts: 3
I've developed a web application and some standalone application. The standalone application is a batch process, developed using java. the batch process runs once in ever hr and i am using timer object to kick off the batch process every hr. the problem is initially someone has to call the timer object to kick off the batch process. now the question is how to automate starting the timer object ? I have a web application already running. is there a way i can attach the timer object to tomcat server ? basically whenever someone starts tomcat server, the timer object needs to be called.
Jaikiran Pai

Joined: Jul 20, 2005
Posts: 9930

You could use a Servlet which is loaded on startup as part of your web application(i.e. a startup servlet). This startup servlet can then start the timer.

[My Blog] [JavaRanch Journal]
Morrison Julia

Joined: Sep 04, 2006
Posts: 3
i am not sure startup servlet is a right solution but after some more research I found "Java Service Wrapper" (http://wrapper.tanukisoftware.org/doc/english/introduction.html) is the right solution.

thanks a lot for the startup servlet suggestion !!!
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

Welcome to JavaRanch!

In an effort to help you get the most from our forums, we've compiled a
list of tips for asking questions here. You can find the list in our
FAQ section here.
In particular please see:

Abbreviations such as "u" or "ur" in
place of "you" and "you are" or "you're" confound language translation software making
it hard for our non-English speaking members to read your posts.
"pgm" is not a word in the English language.

Again, welcome to JavaRanch and good luck with your question.

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
I agree. Here's the link: http://aspose.com/file-tools
subject: Kick-off Java pgm when tomcat starts
Similar Threads
Running batch job on jboss server
Listeners in a cluster
Problems with Tomcat as service on Windows Server 2003
How to make an object strongly reachable?
Making asynchronous calls in Java