如题,补充:
代码如下:
private static final Log logger = Logs.get();
private NutIoc ioc;
private QuartzManager manager;
//cron属性
private final Properties props_cron;
public SyncEnginee(){
// 模拟Mvc环境下的@IocBy
try {
ioc = new NutIoc(new ComboIocLoader("*quartz"));
manager = ioc.get(QuartzManager.class);
manager.clear();
} catch (ClassNotFoundException e) {
logger.error(e);
}finally {
props_cron = HelperUtil.readProperties("/config/cron.properties");
}
}
private void samsCheckinout(){
String cron = props_cron.getProperty("cron.SamsCheckinoutJob");
manager.cron(cron,SamsCheckinoutJob.class);
}
异常如下:
- Not ioc bean? fallback to SimpleJobFactory
org.nutz.ioc.IocException: [samsCheckinoutJob] # For object [samsCheckinoutJob] - type:[class com.xwt.sz.ychsynchronize.quartz.SamsCheckinoutJob]
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:218)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:239)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:146)
at org.nutz.integration.quartz.NutQuartzJobFactory.newJob(NutQuartzJobFactory.java:27)
at org.quartz.core.JobRunShell.initialize(JobRunShell.java:127)
at org.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:375)
Caused by: org.nutz.ioc.ObjectLoadException: Object 'samsCheckinoutJob' without define!
at org.nutz.ioc.loader.combo.ComboIocLoader.load(ComboIocLoader.java:174)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:180)
... 5 more