Can someone please correct me, I've found this example online and bunch of others not working, this particular example throws the following error :
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/collections/SetUtils
at org.quartz.JobDetail.<init>(JobDetail.java:85)
at tralala.org.xml.CronSchedule.<init>(CronSchedule.java:13)
at tralala.org.xml.CronSchedule.main(CronSchedule.java:20)
Here is the code :
CronJob.java
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
public class CronJob implements Job {
public void execute(JobExecutionContext arg0) throws JobExecutionException {
System.out.println("PRINT SOME TEXT LINE");
}
}
CronSchedule.java
import org.quartz.CronTrigger;
import org.quartz.Scheduler;
import org.quartz.SchedulerFactory;
import org.quartz.impl.StdSchedulerFactory;
import org.quartz.JobDetail;
public class CronSchedule {
public CronSchedule ()throws Exception {
SchedulerFactory sf=new StdSchedulerFactory();
Scheduler sched=sf.getScheduler();
JobDetail jd=new JobDetail("job1","group1",CronJob.class);
CronTrigger ct=new CronTrigger("cronTrigger","group2","0 0/1 * * * ?");
sched.scheduleJob(jd,ct);
sched.start();
}
public static void main(String args[]){
try{
new CronSchedule();
}catch(Exception e){}
}
}
I just wanna run(that is actually works) any example of quartz .. I've been searching for some time now and every example either has compile error or like this one(rare one) throws an error. I just wanna run it this one or any .. just to get some inside with a concrete example. I've been reading http://www.opensymphony.com/quartz/wikidocs/TutorialLesson1.html, the examples don't compile .. any suggestions ? tnx