5
如何在早上9點AM的每個月的25號寫入cron表達式來觸發函數?Cron表達式在每個月的25上觸發
當我執行這個代碼,
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
@Service
public class PayrollSchedulerImpl implements PayrollScheduler{
@Scheduled(cron="0 9 25 1 * ?")
public void calculateSalaryScheduled()
{
calculateSalary();
}
public void calculateSalary()
{
/* */
}
}
我得到的錯誤,
java.lang.StackOverflowError
sun.util.calendar.ZoneInfo.getOffsets(Unknown Source)
sun.util.calendar.ZoneInfo.getOffsets(Unknown Source)
java.util.GregorianCalendar.computeFields(Unknown Source)
java.util.GregorianCalendar.computeTime(Unknown Source)
java.util.Calendar.updateTime(Unknown Source)
java.util.Calendar.complete(Unknown Source)
java.util.Calendar.get(Unknown Source)
org.springframework.scheduling.support.CronSequenceGenerator.doNext(CronSequenceGenerator.java:130)
謝謝大家,現在的工作 – elle 2011-05-21 10:56:49
我的Cron表達我的數據庫,我取them.firstly我怎麼可能能c檢查cron表達式,然後由cron表達式來觸發。 – UmaShankar 2016-01-27 06:13:42