TestJob.java
import java.util.Date;
import org.quartz.JobDetail;
import org.quartz.Scheduler;
import org.quartz.SchedulerException;
import org.quartz.SchedulerFactory;
import org.quartz.SimpleTrigger;
import org.quartz.impl.StdSchedulerFactory;
import org.apache.commons.logging.LogFactory;
import javax.transaction.UserTransaction;
public class TestJob {
}
每两分中执行一次XunHuan
package csu.cn.test604;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
public class XunHuan implements Job {
}
因为第一次尝试,所以,只加了一个包进去,结果,运行的时候,老提示少XX每找到。
于是一次次慢慢尝试加包
log4j-1.2.15.jar
jta.jar
commons-collections-3.2.jar
commons-logging-api-1.1.jar
最后可以成功运行
2008-6-4 20:22:12 org.quartz.simpl.SimpleThreadPool initialize
信息: Job execution threads will use class loader of thread: main
2008-6-4 20:22:12 org.quartz.core.QuartzScheduler <init>
信息: Quartz Scheduler v.1.6.0 created.
2008-6-4 20:22:12 org.quartz.simpl.RAMJobStore initialize
信息: RAMJobStore initialized.
2008-6-4 20:22:12 org.quartz.impl.StdSchedulerFactory instantiate
信息: Quartz scheduler 'DefaultQuartzScheduler' initialized from default resource file in Quartz package: 'quartz.properties'
2008-6-4 20:22:12 org.quartz.impl.StdSchedulerFactory instantiate
信息: Quartz scheduler version: 1.6.0
2008-6-4 20:22:12 org.quartz.core.QuartzScheduler start
信息: Scheduler DefaultQuartzScheduler_$_NON_CLUSTERED started.
第0次调用
第1次调用
......