grails / grails-quartz

This project provides integration of the Quartz scheduling framework into the Grails Framework
http://grails.org/plugin/quartz
Apache License 2.0
76 stars 90 forks source link

version 2.0.13 is not working with Grails 4.0.0.M2 #107

Open stefanbozic opened 5 years ago

stefanbozic commented 5 years ago

The current version of the plugin seems not to work with Grails 4.0.0.M2

Simply created a test application grails create-app testQuartz

Added the plugin dependency into build.gradle compile 'org.grails.plugins:quartz:2.0.13'

The following exception occurs

Caused by: java.lang.NoClassDefFoundError: org/quartz/JobExecutionContext
        at grails.plugins.quartz.JobArtefactHandler.isArtefact(JobArtefactHandler.groovy:50)
        at org.grails.compiler.injection.GlobalGrailsClassInjectorTransformation.visit(GlobalGrailsClassInjectorTransformation.groovy:113)
        at org.gradle.api.internal.tasks.compile.ApiGroovyCompiler.execute(ApiGroovyCompiler.java:179)
        at org.gradle.api.internal.tasks.compile.ApiGroovyCompiler.execute(ApiGroovyCompiler.java:57)
        at org.gradle.api.internal.tasks.compile.GroovyCompilerFactory$DaemonSideCompiler.execute(GroovyCompilerFactory.java:80)
        at org.gradle.api.internal.tasks.compile.GroovyCompilerFactory$DaemonSideCompiler.execute(GroovyCompilerFactory.java:68)
        at org.gradle.api.internal.tasks.compile.daemon.AbstractDaemonCompiler$CompilerCallable.call(AbstractDaemonCompiler.java:86)
        at org.gradle.api.internal.tasks.compile.daemon.AbstractDaemonCompiler$CompilerCallable.call(AbstractDaemonCompiler.java:74)
        at org.gradle.workers.internal.DefaultWorkerServer.execute(DefaultWorkerServer.java:42)
        at org.gradle.workers.internal.WorkerDaemonServer.execute(WorkerDaemonServer.java:36)
        at org.gradle.process.internal.worker.request.WorkerAction.run(WorkerAction.java:110)
        at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
        at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
        at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:175)
        at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:157)
        at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:404)
        ... 3 more
Caused by: java.lang.ClassNotFoundException: org.quartz.JobExecutionContext
        ... 19 more
mobilemindtec commented 5 years ago

Hi,

I have same problem. A temporary solution is add this dependency:

    compile("org.quartz-scheduler:quartz:2.2.3") {
        exclude group: 'slf4j-api', module: 'c3p0'
    }
majkelo commented 4 years ago

All kudos for @mobilemindtec however here is whole working workaround for Grails 4.0.1:

    compile("org.quartz-scheduler:quartz:2.2.3") {
        exclude group: 'slf4j-api', module: 'c3p0'
    }
    compile ('org.grails.plugins:quartz:2.0.13') 

(order of dependencies matters)

alankar906 commented 4 years ago

hi Just add following line runtime 'org.grails.plugins:quartz:2.0.13'

srsajid commented 4 years ago

hi Just add following line runtime 'org.grails.plugins:quartz:2.0.13'

didn't work

arjunkr92 commented 6 months ago

I'm using grails 5.3.4, getting the following error:

[ERROR] org.quartz.core.ErrorLogger - An error occured instantiating job to be executed. job= 'GRAILS_JOBS.xyz.DemoJob'
org.quartz.SchedulerException: Job instantiation failed
    at org.springframework.scheduling.quartz.AdaptableJobFactory.newJob(AdaptableJobFactory.java:47)
    at org.quartz.core.JobRunShell.initialize(JobRunShell.java:127)
    at org.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:392)
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'grails.plugins.quartz.GrailsJobFactory$GrailsJob': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type 'java.lang.Object' available: more than one 'primary' bean found among candidates

I have added this in build.gradle

implementation ("org.quartz-scheduler:quartz:2.2.3") { exclude group: 'slf4j-api', module: 'c3p0' } implementation ('org.grails.plugins:quartz:2.0.13')

arjunkr92 commented 6 months ago

Jobs started working after I upgrade the grails version to 5.3.5, it does not work in 5.3.4