我创建了一个调度程序:
SchedulerFactory sf = new StdSchedulerFactory();
Scheduler sched = sf.getScheduler();
Trigger trigger1 = (Trigger)
newTrigger().withSchedule(DailyTimeIntervalScheduleBuilder.dailyTimeIntervalSchedule().startingDailyAt(new TimeOfDay(8,0)).endingDailyAt(new TimeOfDay(11,0)).withInterval(1, IntervalUnit.DAY));
Date ft = sched.scheduleJob(job, trigger1);
但它抛出了一个异常:
Exception in thread "main" java.lang.ClassCastException: org.quartz.TriggerBuilder cannot be cast to org.quartz.Trigger
我该如何解决这个错误?