我们使用的是 Quartz 2.1.5;我们设置了以下属性:
org.quartz.jobStore.class=org.quartz.impl.jdbcjobstore.JobStoreTX
org.quartz.jobStore.driverDelegateClass=org.quartz.impl.jdbcjobstore.CloudscapeDelegate
org.quartz.jobStore.useProperties = true
org.quartz.jobStore.tablePrefix=QRTZ_
org.quartz.jobStore.isClustered=true
org.quartz.jobStore.clusterCheckinInterval=20000
以及以下 bean 配置:
<bean name="abcRequestsJob" class="org.springframework.scheduling.quartz.JobDetailFactoryBean">
<property name="jobClass" value="com.hsc.correspondence.job.AbcRequestsJob" />
<property name="group" value="sftpTransfers"/>
</bean>
<bean id="abcRequestsJobTrigger" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
<property name="jobDetail" ref="abcRequestsJob" />
<property name="group" value="sftpTransfers"/>
<property name="cronExpression" value="${quartz.abcRequests.cronExpression}" />
</bean>
当我们运行时,我们收到一条错误消息
nested exception is org.quartz.JobPersistenceException: Couldn't store trigger 'sftpTransfers.abcRequestsJobTrigger' for 'sftpTransfers.abcRequestsJob'
job:JobDataMap values must be Strings when the 'useProperties' property is set.
Key of offending value: jobDetail
[See nested exception: java.io.IOException: JobDataMap values must be Strings when the 'useProperties' property is set. Key of offending value: jobDetail]
CronTriggerFactoryBean
除了使用对引用的JobDetailFactoryBean
引用或仅将字符串作为属性的不同触发器工厂bean之外,还有另一种配置方法吗?在我们想要使用集群之前,这一切都有效,但现在该作业将被写入一个 blob,他们只希望保留字符串。很好,我该怎么做呢?