- mongodb - 在 MongoDB mapreduce 中,如何展平值对象?
- javascript - 对象传播与 Object.assign
- html - 输入类型 ="submit"Vs 按钮标签它们可以互换吗?
- sql - 使用 MongoDB 而不是 MS SQL Server 的优缺点
我正在使用 Spring Framework 在 Oracle DB 上实现 Quartz Job Store。我的 ApplicationContext.xml 在下面
<bean id="driverJob" class="org.springframework.scheduling.quartz.JobDetailBean">
<property name="jobClass" value="BatchFileCollector" />
</bean>
<bean id="ranchTrigger" class="org.springframework.scheduling.quartz.SimpleTriggerBean">
<property name="jobDetail" ref="driverJob" />
<property name="startDelay" value="2000" />
<property name="repeatInterval" value="10000" />
</bean>
<bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="triggers">
<list>
<ref bean="ranchTrigger" />
</list>
</property>
<property name="dataSource">
<ref bean="dataSource.TEXAN"/>
</property>
<property name="applicationContextSchedulerContextKey">
<value>applicationContext</value>
</property>
<property name="autoStartup">
<value>true</value>
</property>
<property name="configLocation" value="classpath:quartz.properties"/>
</bean>
此配置给我以下错误。
Caused by: org.quartz.JobPersistenceException:
Couldn't store trigger: The job (DEFAULT.driverJob) referenced by the trigger does not exist.
[See nested exception: org.quartz.JobPersistenceException: The job (DEFAULT.driverJob) referenced by the trigger does not exist.]
我正在使用 Spring Framework 2.5.6。我必须升级我的 Quartz 版本吗?我找不到问题。
感谢您的帮助。
最佳答案
您的 SchedulerFactoryBean 也需要注册“driverJob”。除了您的触发器,添加一个 jobDetails 列表。
<bean id="job.statistics.DailyQPSValidationJobTrigger" class="org.quartz.CronTrigger">
<property name="name" value="DailyQPSValidationTrigger" />
<property name="jobName" value="DailyQPSValidation" />
<property name="jobGroup" value="Statistics" />
<property name="volatility" value="false" />
<!-- Each day, 4 o'clock AM -->
<property name="cronExpression" value="0 0 4 * * ?" />
</bean>
<!-- Scheduler -->
<bean id="job.SchedulerProperties" class="somecompany.someproduct.util.spring.PropertiesFactoryBean"
scope="singleton">
<property name="source">
<props>
<prop key="org.quartz.scheduler.instanceId">AUTO</prop>
<prop key="org.quartz.scheduler.instanceName">JobCluster</prop>
<prop key="org.quartz.jobStore.class">org.quartz.impl.jdbcjobstore.JobStoreTX</prop>
<prop key="org.quartz.jobStore.driverDelegateClass">org.quartz.impl.jdbcjobstore.StdJDBCDelegate</prop>
<prop key="org.quartz.jobStore.isClustered">true</prop>
<prop key="org.quartz.jobStore.useProperties">false</prop>
</props>
</property>
</bean>
<bean id="job.Scheduler" class="org.springframework.scheduling.quartz.SchedulerFactoryBean" scope="singleton"
lazy-init="false">
<property name="startupDelay" value="30" />
<property name="waitForJobsToCompleteOnShutdown" value="true" />
<property name="dataSource" ref="jdbc.DataSource" />
<property name="quartzProperties" ref="job.SchedulerProperties" />
<property name="jobDetails">
<list>
<ref bean="job.statistics.DailyQPSValidationJobDetail" />
</list>
</property>
<property name="triggers">
<list>
<ref bean="job.statistics.DailyQPSValidationJobTrigger" />
</list>
</property>
<property name="schedulerListeners">
<list>
<bean class="somecompany.someproduct.job.SchedulerErrorListener">
<property name="monitoringService" ref="monitoring.MonitoringService" />
</bean>
</list>
</property>
<property name="globalJobListeners">
<list>
<bean class="somecompany.someproduct.job.JobErrorListener">
<property name="name" value="JobErrorListener" />
<property name="monitoringService" ref="monitoring.MonitoringService" />
</bean>
</list>
</property>
</bean>
关于java - 使用 Spring 框架的 Quartz JobStore,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1187882/
有没有支持quartz集群的redis jobStore? 有没有人能够构建它? 另一方面,什么是 quartz 簇?我的意思是,它是否能够让两个服务运行指向 redis 的相同 quartz.pro
嗯,我是 Quartz 的新手,我正在关注 this tutorial 并且我配置了我的调度程序实例和 quartz 以使用此属性: properties["quartz.jobStore.lockH
我正在使用 quartz 2.2.1 和 mysql 进行作业存储,为了创建新作业,它会用旧作业数据覆盖 mysql 表中的表内容。没有错误。 这是我的代码: import org.quartz.Sc
考虑这段小代码 from apscheduler.scheduler import Scheduler import time class First(): def __init__(self
我们在集群环境中使用 quartz 调度程序(集群中的两个节点,指向单个 Oracle 数据库)。目前我们有两个作业,几乎每一个小时运行一次。 我们有一个单独的数据库架构用于 quartz 作业。我们
我正在使用 Spring Framework 在 Oracle DB 上实现 Quartz Job Store。我的 ApplicationContext.xml 在下面
我正在使用这个hazelcast quartz scheduler JobStore用于调度后台作业。我正在使用: quartz :2.2.3 Hazelcast:3.7.2(使用默认配置在 Dock
当向调度程序添加或删除作业时,Quartz 偶尔会抛出 JobPersistenceException(在前面的 SQLiteException 之后)。 看起来值得注意的事情: Quartz.NET
我正在 Spring 中使用 JDBC JobStore 实现 Quartz 调度程序。我有一个用例,如果我的应用程序崩溃,并且它有作业要在调度程序崩溃和重新启动之间的时间范围内执行。我的方法是在调度
我希望你们中的一个可爱的人能够帮助我解决这个问题,因为我已经花费了许多徒劳的时间试图让一切都变得美好! 我已经将问题追溯到类加载,并且能够看到当 Quartz 尝试从 jobStore (jobSto
我有工作人员使用 APScheduler 执行任务。它第一天运行完美,然后在尝试获取下一个作业时崩溃了。在出现此类异常后我可以做一些重试吗?或者更好地防止这种情况发生? 这是调度程序代码: __jbs
我第一次存储作业并使用 crontrigger 和以下代码安排它们。 package com.generalsentiment.test.quartz; import static org.quart
我正在尝试为我的 Quartz Scheduler 应用程序配置 JDBC 作业存储。我已经创建了表并在 application.proprties 中提供了配置。但默认 RAM 作业存储正在初始化。
我在集群模式下使用 Quartz 由于过度调用,我在 DB 级别存在一些行锁争用: org.quartz.jobStore.selectWithLockSQL "SELECT * FROM QRTZ_
我想在运行相同作业的触发器之间保留重试计数数据。 我尝试将其存储到 JobExectionContext.JobDetails.JobDataMap 中,这是一个 DirtyHashMap。它被存储,
我正在使用 Flask Sqlalchemy,并在启动调度程序时将 mysql 作为作业存储。但有时当我将作业添加到调度程序时,它会抛出“Mysql Server has gone away”错误,可
我正在使用带有 quartz 的 JDBC 作业存储,因为在集群环境中管理作业。以下是我使用 mysql 的 jdbc 配置: #===============================
我目前正在将 Quartz 升级到版本 2.2。因此,我必须对 JDBCJobstore 使用的表进行一些迁移。 对于表“qrtz_fired_triggers”,添加了具有非空约束的“sched_t
我正在尝试 Quartz 调度程序,并设法使用 Maven 让它与 Spring 一起工作。 我需要做的是配置 Quartz 来存储作业,以便在预定的时间内执行作业。据我所知,Quartz 中有两种类
我有一个使用 flask.ext.sqlalchemy 和 apscheduler.schedulers.background 的 Python Flask 应用程序。我创建了一个 JobStore
我是一名优秀的程序员,十分优秀!