当前页面: 开发资料首页 → J2EE 专题 → 哪位高手用过quartz我今天搞了一天郁闷死我了
哪位高手用过quartz我今天搞了一天郁闷死我了
摘要: 哪位高手用过quartz我今天搞了一天郁闷死我了
我是按这里的方法甚至的,在JBUILDER中调试,没有报错可是就是没有执行定时的事务.
http://www.matrix.org.cn/thread.shtml?forumId=14&topicId=32200&page=1#1
我的job类
package cn.projectbid.search.jobs;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import java.util.*;
public class Helloworld implements Job {
private static Log _log = LogFactory.getLog(Helloworld.class);
public void execute(JobExecutionContext context) throws
JobExecutionException {
_log.info("Hello World! - " + new Date());
System.out.print("Hello !");
}
}
3处配置
QuartzInitializer
Quartz Initializer Servlet
org.quartz.ee.servlet.QuartzInitializerServlet
config-file
/quartz.properties
shutdown-on-unload
true
1
<?xml version="1.0" encoding="UTF-8"?>
helloworld
group1
cn.projectbid.search.jobs.Helloworld
<trigger>
test
group1
helloworld
group1
0 0/1 * * * ?
</trigger>
org.quartz.scheduler.instanceName = TestScheduler
org.quartz.scheduler.instanceId = one
org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool
org.quartz.threadPool.threadCount = 2
org.quartz.threadPool.threadPriority = 4
org.quartz.plugin.triggHistory.class = org.quartz.plugins.history.LoggingTriggerHistoryPlugin
org.quartz.plugin.triggHistory.triggerFiredMessage = Trigger {1}.{0} fired job {6}.{5} at: {4, date, HH:mm:ss MM/dd/yyyy}
org.quartz.plugin.triggHistory.triggerCompleteMessage = Trigger {1}.{0} completed firing job {6}.{5} at {4, date, HH:mm:ss MM/dd/yyyy} with resulting trigger instruction code: {9}
org.quartz.plugin.jobInitializer.class = org.quartz.plugins.xml.JobInitializationPlugin
org.quartz.plugin.jobInitializer.fileName = quartz_job.xml
org.quartz.plugin.jobInitializer.overWriteExistingJobs = false
org.quartz.plugin.jobInitializer.failOnFileNotFound = true
org.quartz.plugin.shutdownhook.class = org.quartz.plugins.management.ShutdownHookPlugin
org.quartz.plugin.shutdownhook.cleanShutdown = true
为什么就是没看到tomcat控制台打印出"Hello !"
关注