由于项目需要一个定时器,所以我找来了Quartz ,在网上找了个例子,把类写好了,配置文件也写好了,部署到Tomcat,只看到了如下信息,却不见效果。
2007-3-13 10:01:27 org.quartz.core.QuartzScheduler <init>
信息: Quartz Scheduler v.1.5.1 created.
2007-3-13 10:01:27 org.quartz.plugins.xml.JobInitializationPlugin initialize
信息: Registering Quartz Job Initialization Plug-in.
2007-3-13 10:01:27 org.quartz.plugins.management.ShutdownHookPlugin initialize
信息: Registering Quartz shutdown hook.
2007-3-13 10:01:27 org.quartz.simpl.RAMJobStore initialize
信息: RAMJobStore initialized.
2007-3-13 10:01:27 org.quartz.impl.StdSchedulerFactory instantiate
信息: Quartz scheduler 'Sched1' initialized from the specified file : 'quartz.properties' from the class resource path.
2007-3-13 10:01:27 org.quartz.impl.StdSchedulerFactory instantiate
信息: Quartz scheduler version: 1.5.1
如果你也遇到相同的问题的话,你可以看看你的Builder Path 下面有没有commons-digester.jar,commons-beanutils.jar这两个jar包。我加上了这两个包之后就正常了。
2007-3-13 10:08:00 org.quartz.core.QuartzScheduler <init>
信息: Quartz Scheduler v.1.5.1 created.
2007-3-13 10:08:00 org.quartz.plugins.xml.JobInitializationPlugin initialize
信息: Registering Quartz Job Initialization Plug-in.
2007-3-13 10:08:00 org.quartz.plugins.management.ShutdownHookPlugin initialize
信息: Registering Quartz shutdown hook.
2007-3-13 10:08:00 org.quartz.simpl.RAMJobStore initialize
信息: RAMJobStore initialized.
2007-3-13 10:08:00 org.quartz.impl.StdSchedulerFactory instantiate
信息: Quartz scheduler 'Sched1' initialized from the specified file : 'quartz.properties' from the class resource path.
2007-3-13 10:08:00 org.quartz.impl.StdSchedulerFactory instantiate
信息: Quartz scheduler version: 1.5.1
2007-3-13 10:08:00 org.quartz.xml.JobSchedulingDataProcessor processFile
信息: Parsing XML file: quartz-jobs.xml with systemId: quartz-jobs.xml validating: false validating schema: file:/D:/Tomcat5.0/work/Catalina/localhost/TestQuartz/loader/org/quartz/xml/job_scheduling_data_1_5.xsd
2007-3-13 10:08:01 org.quartz.xml.JobSchedulingDataProcessor scheduleJobs
信息: Scheduling 2 parsed jobs.
2007-3-13 10:08:01 org.quartz.xml.JobSchedulingDataProcessor scheduleJob
信息: Adding job: group1.jobTest1
2007-3-13 10:08:01 org.quartz.xml.JobSchedulingDataProcessor scheduleJob
信息: Adding job: group1.jobTest2
2007-3-13 10:08:01 org.quartz.xml.JobSchedulingDataProcessor scheduleJobs
信息: 2 scheduled jobs.
2007-3-13 10:08:01 org.quartz.core.QuartzScheduler start
信息: Scheduler Sched1_$_1 started.