Java - Quartz Job在Debug Tomcat上工作,但不在单独的Tomcat上

时间:2016-10-19 07:39:49

标签: java tomcat quartz-scheduler scheduling

我配置了一个Quartz作业,它在Spring附带的eclipse的Debug Tomcat中触发。但是,如果我将我的应用程序部署到单独的Tomcat安装中,则该作业不会触发。

这是我的quartz-config.xml:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
                            http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd">


<context:component-scan base-package="de.java.scheduling" />

<bean name="issueSyncJobDetail" class="org.springframework.scheduling.quartz.JobDetailFactoryBean">
    <property name="jobClass" value="de.java.scheduling.IssueSyncJob" />
    <property name="durability" value="true" />
</bean>

<bean id="cronTrigger"  class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
    <property name="jobDetail" ref="issueSyncJobDetail" />
    <property name="cronExpression" value="0/10 * * ? * MON-FRI" />
</bean>

<!-- Scheduler factory bean to glue together jobDetails and triggers to Configure Quartz Scheduler -->
<bean  class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
    <property name="jobDetails">
        <list>
            <ref bean="issueSyncJobDetail" />
        </list>
    </property>

    <property name="triggers">
        <list>
            <ref bean="cronTrigger" />
        </list>
    </property>
</bean>

知道在Tomcat上部署后作业不会触发的原因是什么?

0 个答案:

没有答案