Giter Club home page Giter Club logo

Comments (7)

mcable01 avatar mcable01 commented on August 26, 2024

This looks like my issue when upgrading my application to 5.1.1 This is how I corrected the error, I Included this in my build.gradle file.

implementation 'org.quartz-scheduler:quartz:2.2.1' // Is not pulled in by default

from grails-quartz.

jglapa avatar jglapa commented on August 26, 2024

Please try setting this in the application.groovy (yml) (apart adding the dependency already mentioned):

quartz.jobStore.'class' = 'org.springframework.scheduling.quartz.LocalDataSourceJobStore' // previosly 'org.quartz.impl.jdbcjobstore.JobStoreTX'

more info here spring-projects/spring-framework#27709 (comment)

from grails-quartz.

sagrawal31 avatar sagrawal31 commented on August 26, 2024

Any update here? Is the plugin no longer maintained?

from grails-quartz.

puneetbehl avatar puneetbehl commented on August 26, 2024

Could you please verify if solutions suggested above in the previous comment by works or NOT?

I didn't get a chance to work on the plugin yet. I would appreciate if someone from the community try to help with the upgrade that way I will able to quickly push out a release soon.

from grails-quartz.

sagrawal31 avatar sagrawal31 commented on August 26, 2024

Yes, I have already been using the followings with my Grails 4.x version and it has been working fine for a year-

implementation("org.quartz-scheduler:quartz:2.3.2") {
    exclude group: "slf4j-api", module: "c3p0"
}

After upgrading to Grails 5.2.3, I don't see any errors but the jobs aren't getting triggered.

When I'm adding quartz.jobStore.'class' = 'org.springframework.scheduling.quartz.LocalDataSourceJobStore', I'm getting the following exception-

2022-12-27 15:29:03.726 DEBUG [  restartedMain] org.mongodb.driver.connection            : Closing connection connectionId{localValue:2, serverValue:2}
2022-12-27 15:29:03.776 ERROR [  restartedMain] o.s.boot.SpringApplication               : Application run failed

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'quartzScheduler': Invocation of init method failed; nested exception is org.quartz.SchedulerConfigException: No local DataSource found for configuration - 'dataSource' property must be set on SchedulerFactoryBean
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1804)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:620)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:936)
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583)
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:147)
        at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:734)
        at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:408)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:308)
        at grails.boot.GrailsApp.run(GrailsApp.groovy:99)
        at grails.boot.GrailsApp.run(GrailsApp.groovy:485)
        at grails.boot.GrailsApp.run(GrailsApp.groovy:472)
        at com.letscooee.Application.main(Application.groovy:11)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)
Caused by: org.quartz.SchedulerConfigException: No local DataSource found for configuration - 'dataSource' property must be set on SchedulerFactoryBean
        at org.springframework.scheduling.quartz.LocalDataSourceJobStore.initialize(LocalDataSourceJobStore.java:97)
        at org.quartz.impl.StdSchedulerFactory.instantiate(StdSchedulerFactory.java:1368)
        at org.quartz.impl.StdSchedulerFactory.getScheduler(StdSchedulerFactory.java:1579)
        at org.springframework.scheduling.quartz.SchedulerFactoryBean.createScheduler(SchedulerFactoryBean.java:679)
        at org.springframework.scheduling.quartz.SchedulerFactoryBean.prepareScheduler(SchedulerFactoryBean.java:616)
        at org.springframework.scheduling.quartz.SchedulerFactoryBean.afterPropertiesSet(SchedulerFactoryBean.java:504)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1863)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1800)
        ... 22 common frames omitted

from grails-quartz.

sagrawal31 avatar sagrawal31 commented on August 26, 2024

Hey, I apologise.

Actually, this is not an issue for me. Job is working fine for me on Grails 5.2.3. I had an immediate statement in my execute method-

def execute() {
        if (KernelUtils.isLocalEnvironment()) {
            log.debug "Not executing ${this.class.name} in local environment"
            return
        }

        ...
}

Sorry for the noise 😔

from grails-quartz.

kaymanov-emitter avatar kaymanov-emitter commented on August 26, 2024

I'm having the same issue on Grails 5.2.3 (I've upgraded from Grails 2 and now no jobs are being triggered) with the following dependencies:

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

I have a lot of jobs and triggers registered at startup like this:

 Trigger createTrigger(FirstmoverExport export) {
        try {
            Trigger trigger = new CronTriggerImpl(triggerName(export), TRIGGER_GROUP, export.cron)
            trigger.jobDataMap.putAll([desc: "First mover export - ${export.id} - ${export.cron}", id: export.id])

            return trigger
        } catch (all) {
            log.error "cannot create first mover trigger with ${export.id} and ${export.cron}"
            return null
        }
    }

All of this happens without error but all of the jobs and triggers are empty when I try to debug:


        def jobGroupNames = quartzScheduler.getJobGroupNames()
        def triggerGroupNames = quartzScheduler.getTriggerGroupNames()

from grails-quartz.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.