Java 石英属性不会触发石英作业

Java 石英属性不会触发石英作业,java,servlets,properties,quartz-scheduler,job-scheduling,Java,Servlets,Properties,Quartz Scheduler,Job Scheduling,我用的是石英2.1.3。 Myquartz.properties: #=================================================== # Configure the Job Initialization Plugin #=================================================== org.quartz.plugin.jobInitializer.class = org.quartz.plugins.xml.XML

我用的是石英2.1.3。 My
quartz.properties

#===================================================
# Configure the Job Initialization Plugin
#===================================================

org.quartz.plugin.jobInitializer.class = org.quartz.plugins.xml.XMLSchedulingDataProcessorPlugin
org.quartz.plugin.jobInitializer.fileNames = quartz-jobs.xml
org.quartz.plugin.jobInitializer.failOnFileNotFound = true
org.quartz.plugin.jobInitializer.scanInterval = 10
org.quartz.plugin.jobInitializer.wrapInUserTransaction = false
My
quart jobs.xml

<?xml version='1.0' encoding='utf-8'?>
<job-scheduling-data xmlns="http://www.quartz-scheduler.org/xml/JobSchedulingData"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.quartz-scheduler.org/xml/JobSchedulingData http://www.quartz-scheduler.org/xml/job_scheduling_data_1_8.xsd"
  version="1.8">

    <schedule>
        <job>
            <name>myjob</name>
            <group>MYJOBGROUP</group>

            <description>Job to Test</description>
            <job-class>com.upd.test.TestQuartz</job-class>
            <trigger>
            <cron>
                <name>my-trigger</name>
                <group>MYTRIGGER_GROUP</group>
                <job-name>myjob</job-name>

                <job-group>MYJOBGROUP</job-group>
                <cron-expression>0/5 * * * * ?</cron-expression>

            </cron>
        </trigger>
    </schedule>
</job-scheduling-data>
<context-param>
         <param-name>quartz:config-file</param-name>
         <param-value>quartz.properties</param-value>
     </context-param>
     <context-param>
         <param-name>quartz:shutdown-on-unload</param-name>
         <param-value>true</param-value>
     </context-param>
     <context-param>
         <param-name>quartz:wait-on-shutdown</param-name>
         <param-value>false</param-value>
     </context-param>
     <context-param>
         <param-name>quartz:start-scheduler-on-load</param-name>
         <param-value>true</param-value>
     </context-param>

<listener>
         <listener-class>
             org.quartz.ee.servlet.QuartzInitializerListener
         </listener-class>
     </listener>
我的
TestQuartz
课程:

package com.upd.test;

import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class TestQuartz implements Job{
    private Logger logger = LoggerFactory.getLogger(TestQuartz.class);
    public void printMe() {
        logger.trace("Run Me");
    }   

    public void execute(JobExecutionContext arg0) throws JobExecutionException {
        printMe();
    }
}
quartz.properties
quartz jobs.xml
我放在
\WEB-INF\classes
当tomcat启动时,我从日志中看到的唯一内容是:

(org.quartz.ee.servlet.QuartzInitializerListener:147) - Quartz Initializer Servlet loaded, initializing Scheduler...
(org.quartz.ee.servlet.QuartzInitializerListener:264) - Quartz Scheduler successful shutdown.
似乎
quartz jobs.xml
不是由
quartz.properties
触发的。我做错什么了吗? 非常感谢您的回复。谢谢大家!

已解决:

- Add threadpool defined in `quartz.properties`.

- Download jta-1.1.jar.
谢谢你的评论

Quartz Scheduler successful shutdown.
当整个应用程序关闭时会出现一条消息,您是否在启动时立即看到此消息?这意味着调度程序甚至没有运行。另外,请确保已加载quartz.properties文件。故意在quartz.properties或quart-jobs.xml中出现语法错误(使用错误的插件类名,在开头添加一些虚假文本…)


当整个应用程序关闭时会出现一条消息,您是否在启动时立即看到此消息?这意味着调度程序甚至没有运行。另外,请确保已加载quartz.properties文件。故意在quartz.properties或quart-jobs.xml中出现语法错误(使用错误的插件类名,在开头添加一些虚假文本…

我检查了tomcat std日志,问题在于属性文件中没有定义线程池,并且缺少事务类。只要下载jta-1.1.jar,现在一切都正常了。无论如何谢谢你!我检查了tomcat std日志,问题在于属性文件中没有定义threadpool,并且缺少事务类。只要下载jta-1.1.jar,现在一切都正常了。无论如何谢谢你!两个文件都加载成功,唯一缺少的是jta-1.1.jar,并修改quartz.properties的一些属性!谢谢:)两个文件都加载成功,唯一缺少的是jta-1.1.jar,并修改quartz.properties的一些属性!谢谢:)