grails-quartz icon indicating copy to clipboard operation
grails-quartz copied to clipboard

props in V2 not getting loaded

Open jglapa opened this issue 8 years ago • 0 comments

I'm migrating a project to Grails3 and just wasted a lot of time figuring out why am I getting really strange errors. Just in case somebody encounters exception like: PSQLException: Bad value for type long : \x it means that your org.quartz.jobStore.driverDelegateClass property is incorrect or not set all. In my case it was the second thing.

After debugging and comparing the code of plugin in v1 and v2 I've came to a conclusion that those lines of code are missing in v2: https://github.com/grails-plugins/grails-quartz/blob/v1.0/QuartzGrailsPlugin.groovy#L398-L400

v2 for reference : https://github.com/grails-plugins/grails-quartz/blob/master/src/main/groovy/quartz/QuartzGrailsPlugin.groovy#L159-L168

So if anybody had a config like that when using plugin v1 and Grails 2.x:

quartz {
    autoStartup = true
    jdbcStore = true
    waitForJobsToCompleteOnShutdown = true
    exposeSchedulerInRepository = false

    props {
        scheduler.skipUpdateCheck = true
        scheduler.idleWaitTime = 1000

        threadPool.'class' = 'org.quartz.simpl.SimpleThreadPool'
        threadPool.threadCount = 10
        threadPool.threadPriority = 7

        jobStore.misfireThreshold = 60000

        jobStore.'class' = 'org.quartz.impl.jdbcjobstore.JobStoreTX'
        jobStore.driverDelegateClass = 'org.quartz.impl.jdbcjobstore.PostgreSQLDelegate'

        jobStore.useProperties = false
        jobStore.tablePrefix = 'QRTZ_'
        jobStore.isClustered = true
        jobStore.clusterCheckinInterval = 5000

        plugin {
            triggerHistory.class = 'org.quartz.plugins.history.LoggingTriggerHistoryPlugin'
            ...
        }
    }
}

he should remove the props { } outer block and things should get better.

It makes me wonder why was this done like that in v1 ? 🤔

jglapa avatar Feb 03 '17 13:02 jglapa