一、配置job的xml里<start-time>的时间格式:
从源码JobSchedulingDataProcessor类中可以看出:格式例如(2012-03-31T05:55:00)
/**
* XML Schema dateTime datatype format. * <p> * See <a href=""> * > */ protected static final String XSD_DATE_FORMAT = "yyyy-MM-dd'T'hh:mm:ss";
二、quartz.properties配置filename:
应该是org.quartz.plugin.jobInitializer.fileNames = my_quartz_jobs.xml
而不是org.quartz.plugin.jobInitializer.fileName = my_quartz_jobs.xml
这个应该和quartz的jar包版本有关,具体哪个版本使用哪个么有研究。
否则可能会报错:
Exception in thread "main" org.quartz.SchedulerException: JobStore SchedulerPlugin 'org.quartz.plugins.xml.JobInitializationPlugin' props could not be configured. [See nested exception: java.lang.NoSuchMethodException: No setter for property 'fileName'] at org.quartz.impl.StdSchedulerFactory.instantiate(StdSchedulerFactory.java:1013) at org.quartz.impl.StdSchedulerFactory.getScheduler(StdSchedulerFactory.java:1399) at org.quartz.impl.StdSchedulerFactory.getDefaultScheduler(StdSchedulerFactory.java:1415) at com.gyb.JobScheduler.startScheduler(JobScheduler.java:28) at com.gyb.JobScheduler.main(JobScheduler.java:23) Caused by: java.lang.NoSuchMethodException: No setter for property 'fileName' at org.quartz.impl.StdSchedulerFactory.setBeanProps(StdSchedulerFactory.java:1287) at org.quartz.impl.StdSchedulerFactory.instantiate(StdSchedulerFactory.java:1011) ... 4 more
附:网上整理的问题