Skip to content

BeanCurrentlyInCreationException when used spring security with spring boot 2.3.0.RELEASE and spring.main.lazy-initialization: true and management.server.port #8596

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

Closed
dante-ricalde opened this issue May 26, 2020 · 2 comments
Assignees
Labels
status: duplicate A duplicate of another issue type: bug A general bug

Comments

@dante-ricalde
Copy link

dante-ricalde commented May 26, 2020

Describe the bug
I get the following error:

Caused by: org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'authenticationPrincipalArgumentResolverConfigurer': Requested bean is currently in creation: Is there an unresolvable circular reference?

When I start a minimal spring boot application with spring-security added as dependency and
the following properties configured:

management.server.port=8082
spring.main.lazy-initialization=true

There is a circular reference problem between these two configurations: ServerHttpSecurityConfiguration and DelegatingWebFluxConfiguration

I also want to reference this issue: spring-projects/spring-boot#21580
opened to spring boot with the same error.
Could you please help with this error and break that cycle error in this configuration ServerHttpSecurityConfiguration???

To Reproduce
Start the sample application Running the class: DemoApplication

Sample
demo.zip

I have uplodaded the sample to my own repo:
https://github.com/dante-ricalde/tests/blob/master/demo.zip

@rwinch
Copy link
Member

rwinch commented May 29, 2020

Thanks for the excellent sample. I created spring-projects/spring-framework#25166 and gh-8613 The first issue is for Spring Framework and I think it is the root of the problem. The second issue is a workaround in Spring Security. I'm going to close this issue since there are separate tickets for the action items.

@rwinch rwinch closed this as completed May 29, 2020
@rwinch rwinch added status: duplicate A duplicate of another issue and removed status: waiting-for-triage An issue we've not yet triaged labels May 29, 2020
@wilkinsona
Copy link
Member

Thanks for tracking this one down, @rwinch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: duplicate A duplicate of another issue type: bug A general bug
Projects
None yet
Development

No branches or pull requests

3 participants