mrankin32 opened a new issue, #16194:
URL: https://github.com/apache/grails-core/issues/16194
I am using quartz plugin version 2.0.12 and Grails 3.2.11 and I am wanting
to create the required quartz tables in the bootstrap init with jdbcStore =
true in the quartz config. I need to find a way to do this so when I clone an
amazon instances of my application in AWS I don't have to manually create the
quartz tables every time I clone the instance. The problem I am having is the
the quartz plugin is initializing and trying to read from the QRTZ_JOB_DETAILS
table before the table is even created in my bootstrap so the application fails
to run with the following stacktrace:
`[02/07/2018 15:49:21] ERROR : org.springframework.boot.SpringApplication :
Application startup failed
org.quartz.JobPersistenceException: Couldn't obtain job names: Table
"QRTZ_JOB_DETAILS" not found; SQL statement:
SELECT JOB_NAME, JOB_GROUP FROM QRTZ_JOB_DETAILS WHERE SCHED_NAME =
'quartzScheduler' AND JOB_GROUP LIKE ? [42102-194]
at
org.quartz.impl.jdbcjobstore.JobStoreSupport.getJobNames(JobStoreSupport.java:1889)
...
at
org.quartz.impl.jdbcjobstore.JobStoreSupport.getJobNames(JobStoreSupport.java:1887)
... 35 more
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':bootRun'.`
My bootstrap looks like this:
`
class BootStrap {
def dataSource
def init = { servletContext ->
def queries = []
queries.add("CREATE TABLE if not exists qrtz_job_details ( " +
"SCHED_NAME VARCHAR(120) NOT NULL," +
"JOB_NAME VARCHAR(200) NOT NULL," +
"JOB_GROUP VARCHAR(200) NOT NULL," +
"DESCRIPTION VARCHAR(250) NULL," +
"JOB_CLASS_NAME VARCHAR(250) NOT NULL," +
"IS_DURABLE BOOLEAN NOT NULL," +
"IS_NONCONCURRENT BOOLEAN NOT NULL," +
"IS_UPDATE_DATA BOOLEAN NOT NULL," +
"REQUESTS_RECOVERY BOOLEAN NOT NULL," +
"JOB_DATA BINARY NULL," +
"PRIMARY KEY (SCHED_NAME,JOB_NAME,JOB_GROUP)" +
");")
Sql sql = new Sql(dataSource)
queries.each { query ->
sql.execute(query)
}
sql.close()
}
}
`
Is there a way to automatically generate the quartz tables in any way
without manual intervention?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]