Перенес код из сервлета в обычный класс. Снова валится на той строке но exception уже другой. Привожу код класса и exception с логами. Код | package roomproject;
import java.util.Date;
import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.quartz.JobDetail; import org.quartz.Scheduler; import org.quartz.SchedulerFactory; import org.quartz.SimpleTrigger; import org.quartz.TriggerUtils; import org.quartz.impl.StdSchedulerFactory; /** * <p>Title: </p> * * <p>Description: </p> * * <p>Copyright: Copyright (c) 2007</p> * * <p>Company: </p> * * @author not attributable * @version 1.0 */ public class Scanner { public Scanner() { } public void run() throws Exception { Log log = LogFactory.getLog(Scanner.class);
log.info("------- Initializing ----------------------");
// First we must get a reference to a scheduler SchedulerFactory sf = new StdSchedulerFactory(); Scheduler sched = sf.getScheduler();
log.info("------- Initialization Complete -----------");
log.info("------- Scheduling Jobs -------------------");
// computer a time that is on the next round minute Date runTime = TriggerUtils.getEvenMinuteDate(new Date());
// define the job and tie it to our HelloJob class JobDetail job = new JobDetail("job1", "group1", roomproject.MyJob.class);
// Trigger the job to run on the next round minute SimpleTrigger trigger = new SimpleTrigger("trigger1", "group1", runTime);
// Tell quartz to schedule the job using our trigger sched.scheduleJob(job, trigger); log.info(job.getFullName() + " will run at: " + runTime);
// Start up the scheduler (nothing can actually run until the // scheduler has been started) sched.start(); log.info("------- Started Scheduler -----------------");
// wait long enough so that the scheduler as an opportunity to // run the job! log.info("------- Waiting 90 seconds... -------------"); try { // wait 90 seconds to show jobs Thread.sleep(90L * 1000L); // executing... } catch (Exception e) { }
// shut down the scheduler log.info("------- Shutting Down ---------------------"); sched.shutdown(true); log.info("------- Shutdown Complete -----------------"); }
public static void main(String[] args) throws Exception {
Scanner example = new Scanner(); example.run();
}
}
|
Exception Код | 26/7/2007 9:43:00 roomproject.Scanner run INFO: ------- Initializing ---------------------- 26/7/2007 9:43:04 org.quartz.simpl.SimpleThreadPool initialize INFO: Job execution threads will use class loader of thread: main 26/7/2007 9:43:04 org.quartz.core.QuartzScheduler <init> INFO: Quartz Scheduler v.1.6.0 created. 26/7/2007 9:43:04 org.quartz.simpl.RAMJobStore initialize INFO: RAMJobStore initialized. 26/7/2007 9:43:04 org.quartz.impl.StdSchedulerFactory instantiate INFO: Quartz scheduler 'DefaultQuartzScheduler' initialized from default resource file in Quartz package: 'quartz.properties' 26/7/2007 9:43:04 org.quartz.impl.StdSchedulerFactory instantiate INFO: Quartz scheduler version: 1.6.0 26/7/2007 9:43:05 roomproject.Scanner run INFO: ------- Initialization Complete ----------- 26/7/2007 9:43:06 roomproject.Scanner run INFO: ------- Scheduling Jobs ------------------- Exception in thread "main" java.lang.NoSuchMethodError: org.apache.commons.collections.SetUtils.orderedSet(Ljava/util/Set;)Ljava/util/Set; at org.quartz.JobDetail.<init>(JobDetail.java:85) at roomproject.Scanner.run(Scanner.java:47) at roomproject.Scanner.main(Scanner.java:81)
|
Добавлено через 2 минуты и 18 секундJobDetail.java:85 показывает строку: Код | // Constructors public JobDetail() { }
|
|