public static void main(String[] args) {
Ioc ioc = new NutIoc(new JsonLoader("org/nutz/integration/quartz/quartz.js"));
QuartzManager qm = ioc.get(QuartzManager.class, "quartzManager");
QuartzJob job1 = new QuartzJob();
job1.setJobName("job1");
job1.setJobGroup("group1");
job1.setCron("*/2 * * * * ?");
job1.setClassName(HelloJob.class.getName());
qm.add(job1);
}
2016-08-23 10:43:34,002 [DefaultQuartzScheduler_QuartzSchedulerThread] DEBUG org.nutz.ioc.impl.NutIoc - Get 'helloJob'<class com.chw.test.quartz.HelloJob>
2016-08-23 10:43:34,002 [DefaultQuartzScheduler_QuartzSchedulerThread] DEBUG org.nutz.ioc.impl.NutIoc - >> Load definition name=helloJob
2016-08-23 10:43:34,002 [DefaultQuartzScheduler_QuartzSchedulerThread] WARN o.n.i.quartz.NutQuartzJobFactory - Not ioc bean? fallback to SimpleJobFactory
org.nutz.ioc.IocException: [helloJob] # For object [helloJob] - type:[class com.chw.test.quartz.HelloJob]
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:226)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:265)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:150)
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 'helloJob' without define!
at org.nutz.ioc.loader.combo.ComboIocLoader.load(ComboIocLoader.java:174)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:188)
... 5 common frames omitted
大神给讲讲