-
hi all,
am currently working on a project using JSF, EJb3.0 and i was looking for a scheduler EJB that can run a query at a specific time i determine .. can any1 help?! thnx alot in advance.
-
You might want to look into Quartz.
-
well, i took ur advise and i took a look at Quartz; but when i tried the 1st example in the tutorial.. here's what i got:
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
at org.quartz.impl.StdSchedulerFactory.(StdSchedulerFactory.java:247)
at emak.model.client.UsersFacadeClientEmbed.main(UsersFacadeClientEmbed.java:53)
the code i was trying to run is:
public class UsersFacadeClientEmbed implements Job {
public static void main(String[] args) {
try {
SchedulerFactory schedFact = new org.quartz.impl.StdSchedulerFactory();
Scheduler sched = schedFact.getScheduler();
sched.start();
JobDetail jobDetail = new JobDetail("myJob",
null,
UsersFacadeClientEmbed.class);
Trigger trigger = TriggerUtils.makeSecondlyTrigge(); trigger.setStartTime(TriggerUtils.getEvenMinuteDate(new Date()));
trigger.setName("myTrigger");
sched.scheduleJob(jobDetail, trigger);
} catch (SchedulerException ex){
ex.printStackTrace();
}
}
public void execute(JobExecutionContext jobExecutionContext) {
System.out.println("test successfull >>>>>>>>>");
}
}
can anyone plz help??!! thnx alot