This repository was archived by the owner on Dec 2, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
Defining a job as a prototype scoped bean causes a cyclic dependency on startup #11
Comments
longwa
pushed a commit
to longwa/grails-schwartz
that referenced
this issue
Nov 5, 2018
Weirdly, this fix works for the sample application but still fails in our actual application for what appears to to be the same reason. The injected |
Actually, looks like if you declare the bean as |
longwa
pushed a commit
to longwa/grails-schwartz
that referenced
this issue
Nov 5, 2018
Updated the PR to just fetch the jobs on demand when schedule is called instead of injecting them. This makes it compatible regardless of how the user configures the wiring behavior. |
longwa
pushed a commit
to longwa/grails-schwartz
that referenced
this issue
Dec 17, 2020
longwa
pushed a commit
to longwa/grails-schwartz
that referenced
this issue
Dec 17, 2020
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
If you define a bean that implements
SchwartzJob
as prototype scoped inresources.groovy
You will get the following on startup:
I guess in the singleton case, the beans injected into the job array don't need to be initialize again, so it works.
The fix is simple, the
quartzService
reference inSchwartzJob
just needs to be annotated with@Lazy
:Simple project to reproduce:
https://github.com/longwa/grails-schwartzTest
The text was updated successfully, but these errors were encountered: