I am using Spring 3.2
and Quartz 2.2
.
My target Class
and method
,
public class Producer {
pu
Try one of the following:
Trigger newTrigger = tb.withSchedule(SimpleScheduleBuilder.simpleSchedule().withIntervalInSeconds(2)).build();
or
Trigger newTrigger = tb.withSchedule(SimpleScheduleBuilder.repeatSecondlyForever(2)).build();
Both are syntactically valid. It looks like your issue with Trigger newTrigger = tb.withSchedule(simpleSchedule().withIntervalInSeconds(triggerInSec).build());
is caused by incorrect bracketing. ie build() should not have an extra bracket after it, as it returns a trigger.