Comments (7)
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.
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.
Any update here? Is the plugin no longer maintained?
from grails-quartz.
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.
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.
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.
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)
- "No Session found for current thread" for job listener
- Conflicting bean HOT 1
- Race condition with dataSource on startup HOT 1
- Broken links in Grails plugin page
- How to configure multiple schedulers to have more than one thread pool?
- version 2.0.13 is not working with Grails 4.0.0.M2 HOT 6
- java -jar run xxx.jar not working HOT 1
- Version 2.0.13 not compatible with Groovy 3 HOT 1
- The trigger configuration stored in the database is reset after application restart
- Plugin Prevents application to startup with a job in past date
- Timezone parameter is ignored
- Long time running jobs
- How to disable quartz in unit tests ?
- 'grails create-job' command does not exist in grails 6
- When I set autoStartup to false the job does not work HOT 1
- Set-up GitHub Workflows HOT 1
- Verify all the tests are up-to-date and green (passing) HOT 1
- Review Documentation and update accordingly
- Could not instantiate custom Metaclass for class: grails.plugins.quartz.QuartzJob$Trait$Helper HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grails-quartz.