job类
package net.wendal.nutzbook.quartz;
import org.nutz.dao.Dao;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import net.wendal.nutzbook.bean.Tom;
@IocBean
public class CleanNonActiveUserJob implements Job{
@Inject
protected Dao dao;
@Override
public void execute(JobExecutionContext cont) throws JobExecutionException {
Tom t1=new Tom();
System.out.println("创建对象");
t1.setName("fff");
System.out.println("插入操作");
dao.insert(t1);
System.out.println("插入成功");
}
}
这个类也是子模块,开启tomcat之后就隔一段时间打印“创建对象”,“插入操作”,但是没有执行insert语句,也没有打印后面的“插入成功”