参照教程写了一个TestJob
public class TestJob implements Job{
private static final Log log = Logs.get();
public void execute(JobExecutionContext context) throws JobExecutionException {
log.debug("Hello World! MyJob is executing.");
}
}
可以正常注入2016-07-22 12:44:43,121 org.nutz.integration.quartz.NutQuartzCronJobFactory.init(NutQuartzCronJobFactory.java:45) DEBUG - job define name=me.mk.nutztorrent.quartz.job.TestJob cron=0 * * * * ?
但是每次运行都会报错
org.nutz.ioc.IocException: [testJob] # For object [testJob] - type:[class me.mk.nutztorrent.quartz.job.TestJob]
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:217)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:235)
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 'testJob' without define!
at org.nutz.ioc.loader.combo.ComboIocLoader.load(ComboIocLoader.java:166)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:181)
... 5 more
请问下这是什么原因