New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Circular reference error when autowiring JobBuilderFactory #3991
Labels
has: minimal-example
Bug reports that provide a minimal complete reproducible example
in: core
type: bug
Milestone
Comments
cppwfs
added
status: waiting-for-triage
Issues that we did not analyse yet
type: bug
labels
Sep 7, 2021
cppwfs
pushed a commit
to cppwfs/spring-cloud-task
that referenced
this issue
Sep 7, 2021
Makes sure that dependencies are passed in via parameters in bean declaraction vs. Autowiring refer to spring-projects/spring-batch#3991 resolves spring-cloud#797
cppwfs
pushed a commit
to cppwfs/spring-cloud-task
that referenced
this issue
Sep 7, 2021
Makes sure that dependencies are passed in via parameters in bean declaraction vs. Autowiring refer to spring-projects/spring-batch#3991 resolves spring-cloud#797
fmbenhassine
added
has: minimal-example
Bug reports that provide a minimal complete reproducible example
in: core
and removed
status: waiting-for-triage
Issues that we did not analyse yet
labels
Sep 8, 2021
cppwfs
pushed a commit
to cppwfs/spring-cloud-task
that referenced
this issue
Sep 16, 2021
Makes sure that dependencies are passed in via parameters in bean declaraction vs. Autowiring refer to spring-projects/spring-batch#3991 resolves spring-cloud#797 Updated based on code review
fmbenhassine
added a commit
to fmbenhassine/spring-batch
that referenced
this issue
Apr 25, 2022
Before this commit, the datasource was autowired in AbstractBatchConfiguration. This was causing context startup failures when no datasource or more than one datasource is present in the context. This commit fixes these failures by looking for the datasource in the application context. This also prevents cyclic configuration dependencies when the datasource bean is defined in the same class where other batch artifacts are autowired. Issue spring-projects#3991
fmbenhassine
added a commit
to fmbenhassine/spring-batch
that referenced
this issue
May 9, 2022
Before this commit, the datasource was autowired in AbstractBatchConfiguration. This was causing context startup failures when no datasource or more than one datasource is present in the context. This commit fixes these failures by looking for the datasource in the application context. This also prevents cyclic configuration dependencies when the datasource bean is defined in the same class where other batch artifacts are autowired. Issue spring-projects#3991
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
has: minimal-example
Bug reports that provide a minimal complete reproducible example
in: core
type: bug
Scenario
When a user autowires
JobBuilderFactory
andStepBuilderFactory
in a Java configuration where one of the beans required by the batch application is in the same configuration, boot throws aBeanCurrentlyInCreationException
.Starting in Spring Boot 2.6.M2, boot checks for circular references by default (
spring.main.allow-circular-references=false
) . In previous releases of spring boot thespring.main.allow-circular-references
was defaulted to true.Sample Application
A sample application can be found here: https://github.com/cppwfs/batchsamp
EDIT: Related SO thread: https://stackoverflow.com/questions/69379794
The text was updated successfully, but these errors were encountered: