threadpool类未指定错误

时间:2013-06-05 17:53:20

标签: java quartz-scheduler

在获取调度程序对象时,我在初始化StdSchedulerFactory后出错。

init method failed; nested exception is org.quartz.SchedulerException: ThreadPool class not specified.

代码是:

        Properties properties = new Properties();
    properties.put("org.quartz.scheduler.instanceName", name);
    properties.put("org.quartz.threadPool.threadCount", String.valueOf(numberOfThreads));
    properties.put("org.quartz.scheduler.skipUpdateCheck", "true");

    StdSchedulerFactory stdSchedulerFactory = new StdSchedulerFactory();
    stdSchedulerFactory.initialize(properties);
    Scheduler scheduler = stdSchedulerFactory.getScheduler();
    scheduler.start();

你能建议任何解决方案吗?

1 个答案:

答案 0 :(得分:8)

你可能至少需要这个:

properties.put("org.quartz.threadPool.class", "org.quartz.simpl.SimpleThreadPool");

您可能需要查看一些石英示例并配置更多属性。