最近我尝试配置我的 grails 应用程序以与石英调度程序一起使用。不幸的是,我未能配置 JDBC 作业存储。石英插件似乎忽略了quartz.properties
文件,其中表前缀定义为Z_STAFF_SCHEDULER
. 应用程序启动失败并出现异常:
引起:org.springframework.scheduling.SchedulingException:无法启动Quartz Scheduler;嵌套异常是 org.quartz.SchedulerConfigException:在作业恢复期间发生故障。[见嵌套异常:org.quartz.impl.jdbcjobstore.LockException:获取数据库行锁失败:表'testing.qrtz_locks'不存在[见嵌套异常:com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException:表' testing.qrtz_locks' 不存在]]
以下是中的相关代码application.groovy
:
quartz {
autoStartup = true
jdbcStore = true
waitForJobsToCompleteOnShutdown = true
exposeSchedulerInRepository = false
props {
scheduler.skipUpdateCheck = true
}
}
environments {
test {
quartz {
jdbcStore = false
autoStartup = false
}
}
}
grails.config.locations = ["classpath:conf/quartz.properties"]
这是我的配置quartz.properties
:
#============================================================================
# Configure Main Scheduler Properties
#============================================================================
org.quartz.scheduler.instanceName = StaffScheduler
org.quartz.scheduler.instanceId = AUTO
#============================================================================
# Configure ThreadPool
#============================================================================
org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool
org.quartz.threadPool.threadCount = 25
org.quartz.threadPool.threadPriority = 5
#============================================================================
# Configure JobStore
#============================================================================
org.quartz.jobStore.misfireThreshold = 60000
org.quartz.jobStore.class = org.quartz.impl.jdbcjobstore.JobStoreTX
org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.StdJDBCDelegate
org.quartz.jobStore.useProperties = false
org.quartz.jobStore.dataSource = development
org.quartz.jobStore.tablePrefix = Z_STAFF_SCHEDULER_
org.quartz.jobStore.isClustered = true
org.quartz.jobStore.clusterCheckinInterval = 20000
#============================================================================
# Configure Datasources
#============================================================================
org.quartz.dataSource.development.driver = com.mysql.jdbc.Driver
org.quartz.dataSource.development.URL = jdbc:mysql://localhost:3306/testing?useSSL=false
org.quartz.dataSource.development.user = testing
org.quartz.dataSource.development.password = nopass
org.quartz.dataSource.development.maxConnections = 10
org.quartz.dataSource.development.validationQuery = select 1
请问有谁可以帮我吗?
我正在使用 grails 3.2.3 和石英插件 2.0.9