Announcement Announcement Module
Collapse
No announcement yet.
Spring quartz not work for quartz 2.1.7 Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring quartz not work for quartz 2.1.7

    Hi,

    I can't get below config work for quartz 2.1.7 (while it works for 2.1.6) with spring 3.2.0 release version:

    <bean id="quartzJob" class="sample.quartz.SampleJob"></bean>


    <bean name="jobtask2"
    class="org.springframework.scheduling.quartz.JobDe tailFactoryBean">

    <property name="jobClass"
    value="sample.quartz.SampleJobBean" />

    <property name="jobDataAsMap">
    <map>
    <entry key="task" value-ref="quartzJob" />
    </map>
    </property>

    </bean>

    <bean id="trigger2"
    class="org.springframework.scheduling.quartz.Simpl eTriggerFactoryBean">

    <property name="jobDetail" ref="jobtask2" />
    <property name="repeatInterval" value="5000" />
    <property name="startDelay" value="1000" />

    </bean>



    <bean id="startQuertz" lazy-init="false" autowire="no"
    class="org.springframework.scheduling.quartz.Sched ulerFactoryBean">


    <property name="jobDetails">
    <list>
    <ref bean="jobtask2" />
    </list>
    </property>

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


    errors:

    Caused by: org.quartz.SchedulerException: Jobs added with no trigger must be durable.
    at org.quartz.core.QuartzScheduler.addJob(QuartzSched uler.java:916)
    at org.quartz.impl.StdScheduler.addJob(StdScheduler.j ava:269)
    at org.springframework.scheduling.quartz.SchedulerAcc essor.addJobToScheduler(SchedulerAccessor.java:342 )
    at org.springframework.scheduling.quartz.SchedulerAcc essor.registerJobsAndTriggers(SchedulerAccessor.ja va:284)
    at org.springframework.scheduling.quartz.SchedulerFac toryBean.afterPropertiesSet(SchedulerFactoryBean.j ava:511)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.invokeInitMethods(Abstr actAutowireCapableBeanFactory.java:1545)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.initializeBean(Abstract AutowireCapableBeanFactory.java:1483)
    ... 12 more


    Does anyone ever see this?

    Thanks
    Ma Ling

  • #2
    You have to set durability property to true while defining your job bean:



    <bean name="jobtask2" class="org.springframework.scheduling.quartz.JobDe tailFactoryBean">
    <property name="jobClass" value="sample.quartz.SampleJobBean" />
    <property name="jobDataAsMap">
    <map>
    <entry key="task" value-ref="quartzJob" />
    </map>
    </property>
    <property name="durability" value="true" />
    </bean>

    Comment

    Working...
    X