I'm trying to trigger a job manually from a controller in my Grails4 application.
I'm seeing this error:
groovy.lang.MissingMethodException: No signature of method: static com.myapp.MyJob.triggerNow() is applicable for argument types: (LinkedHashMap) values: [[foo:It works]]
I've seen older posts with the same issue, but they were using older versions of the plugin and I have tried all of the suggestions (package of controller and job the same, inject the quartzScheduler in the controller).
Here's my controller:
package com.myapp
class MyController {
def quartzScheduler
def myAction() {
MyJob.triggerNow([foo:"It works"])
}
}
Here's my job:
package com.myapp
class MyJob {
static triggers = {}
def execute(context) {
println context.mergedJobDataMap.get('foo')
}
}
My build.gradle file has this:
compile 'org.grails.plugins:quartz:2.0.13'
compile 'org.quartz-scheduler:quartz:2.2.1'