Spring 定时任务Quartz,Cron表达式提示cron expression must consist of 6 fields
我要设置定时任务,每年的6月31日执行。
按照论坛上说的,cron可以设置6位或7位域。
仿照规则,有表达式:@Scheduled(cron="0 0 0 31 6 ? 2014-2099")
可是一直启动报错,提示必须6位域?
网上都说可以6位或7位域啊,求解释。
java.lang.IllegalArgumentException: cron expression must consist of 6 fields (found 7 in 0 0 0 31 6 ? 2014-2099)
at org.springframework.scheduling.support.CronSequenceGenerator.parse(CronSequenceGenerator.java:233)
at org.springframework.scheduling.support.CronSequenceGenerator.<init>(CronSequenceGenerator.java:81)
at org.springframework.scheduling.support.CronTrigger.<init>(CronTrigger.java:54)
at org.springframework.scheduling.support.CronTrigger.<init>(CronTrigger.java:44)