Solved

How to auto schdedule to run jsp prgrams and make it excute once only (do not repeat even if we restart  the server)

Posted on 2007-03-21
34
478 Views
Last Modified: 2013-12-02
1) How to auto schdedule to run jsp prgrams with apache/tomcat server.
2) will the program be executed (eventhough for that day it has already run) if we stop and start the server
3) how to avoid it running again
0
Comment
Question by:Yap_YokeWan
  • 7
  • 7
  • 6
  • +4
34 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 18762631
Web apps run only when the receive a request from a client. What does it do?
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 18762633
If you only want it to serve one request, set a flag and only allow it to service one request
0
 

Author Comment

by:Yap_YokeWan
ID: 18762646
how do I do that... I need the program to run everyday at a fix time
0
Create the perfect environment for any meeting

You might have a modern environment with all sorts of high-tech equipment, but what makes it worthwhile is how you seamlessly bring together the presentation with audio, video and lighting. The ATEN Control System provides integrated control and system automation.

 
LVL 86

Expert Comment

by:CEHJ
ID: 18762655
That's not how webapps work. They run when the client makes a request. As i asked - what does it do?
0
 
LVL 12

Accepted Solution

by:
keyurkarnik earned 100 total points
ID: 18762681
If you need your program to run only once, you should not make it a webapp.
You should make it a normal java program and have it run via a cron job in linux/unix
or as  a scheduled task in windows.

As it is a scheduled task, there is no point in making the program wait for an entire day then run once - its better to run it via a acheduled task
0
 
LVL 10

Assisted Solution

by:Jaax
Jaax earned 100 total points
ID: 18762734
Probably you have not chosen the right candidate to realise your requirements.
If you need to run a job at a specified time/periodically-
1.Use OS level schedulers like cron in Unix
2.For schedulers within JVM, you may consider the Quartz framework
0
 
LVL 12

Expert Comment

by:keyurkarnik
ID: 18762738
Jaax,
Please read previous comments so that you do not repeat them :)
0
 
LVL 92

Assisted Solution

by:objects
objects earned 100 total points
ID: 18763120
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 18763177
If your server is a WIndows box you can use Task Scheduler
0
 
LVL 10

Expert Comment

by:Jaax
ID: 18763204
keyurkarnik: When I began writing, I didn't find yours :) But once I submitted mine was inserted after yours. You seemed to have posted in the meantime - which is out of my scope
0
 

Author Comment

by:Yap_YokeWan
ID: 18768611
can window scheduler  trigger java program since there is suggestion to do this way. How to do this?
0
 
LVL 92

Expert Comment

by:objects
ID: 18768662
yes, just specify the command you want executed.
0
 

Author Comment

by:Yap_YokeWan
ID: 18768988
where can I find some sample - on areas such as to  specify the application,  the location of program,  and the method to trigger
0
 
LVL 92

Expert Comment

by:objects
ID: 18769003
0
 

Author Comment

by:Yap_YokeWan
ID: 18769268
thanks for the given link... is there any example how to schedule the task which require it to trigger java method which is using apache/tomcat with windows os
0
 
LVL 92

Expert Comment

by:objects
ID: 18769277
if u want to trigger something running inside a webapp then use quartz
0
 
LVL 12

Expert Comment

by:keyurkarnik
ID: 18769633
Could you explain the exact scenario where you need to use this. Cos if you need it to run only once and is not based on any client requests, you should NOT need to use  Tomcat or any webcontainers as such.
0
 

Author Comment

by:Yap_YokeWan
ID: 18769727
I have to run the program  at a particular time "EVERYDAY". what is the best solution to this? If I dont make the system to do this, then i have to run this manually daily.
0
 
LVL 86

Assisted Solution

by:CEHJ
CEHJ earned 100 total points
ID: 18769729
Run a batch file that starts the app with Windows Task Scheduler
0
 
LVL 30

Expert Comment

by:Mayank S
ID: 18772788
If it is also just a Windows based scheduling, you also don't need to use Java for it. You can use any of VB, C++, C# & family.

BTW are you also using Tomcat for something else? You've still not completely answered: >> if u want to trigger something running inside a webapp, and >> Could you explain the exact scenario where you need to use this.
0
 

Author Comment

by:Yap_YokeWan
ID: 18776345
I have created the  program wirttten in jsp/java as all my application is using these language. some of those programs are run currently by clicking a button from the webpage and then it will run in order for some process to be executed. I would want this process to be schedule so that no clicking is require from the web page  
0
 
LVL 92

Expert Comment

by:objects
ID: 18776391
use quartz :)
0
 
LVL 30

Expert Comment

by:Mayank S
ID: 18776404
I would agree
0
 

Author Comment

by:Yap_YokeWan
ID: 18777490
is there any simple example on how I could use that to work. In this case, can window scheduler still work
0
 
LVL 30

Assisted Solution

by:Mayank S
Mayank S earned 100 total points
ID: 18777510
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 18778297
>>it will run in order for some process to be executed.

Execute the process directly in the scheduler
0
 
LVL 92

Expert Comment

by:objects
ID: 19310899
How is CEHJ's comment not just repeating what has already been posted???
0
 
LVL 20

Expert Comment

by:Venabili
ID: 19310960
CEHJ has more than one comment. He gets points not just for the last one - because his first ones are worth also. And can you show me which comment says "Execute the process directly in the scheduler"?
0
 
LVL 92

Expert Comment

by:objects
ID: 19311025
eg.>  yes, just specify the command you want executed.
And it only takes 10 seconds to mention that you are repeating what has already been said ;)
0

Featured Post

Simple, centralized multimedia control

Watch and learn to see how ATEN provided an easy and effective way for three jointly-owned pubs to control the 60 televisions located across their three venues utilizing the ATEN Control System, Modular Matrix Switch and HDBaseT extenders.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question