Skip to content

Circular reference error when autowiring JobBuilderFactory #3991

Closed
@cppwfs

Description

@cppwfs

Scenario

When a user autowires JobBuilderFactory and StepBuilderFactory in a Java configuration where one of the beans required by the batch application is in the same configuration, boot throws a BeanCurrentlyInCreationException.
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 the spring.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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions