admin管理员组

文章数量:1417434

I'm using FlightRecorderApplicationStartup to gain insight in my spring application startup.

I find numerous spring.beans.instantiate events tagged like this:

beanName=.springframework.security.authenticationManager,exception=class .springframework.beans.factory.BeanCurrentlyInCreationException, message=Error creating bean with name '.springframework.security.authenticationManager': Requested bean is currently in creation: Is there an unresolvable circular reference or an asynchronous initialization dependency?, beanName=.springframework.security.authenticationManager,exception=class .springframework.beans.factory.BeanCurrentlyInCreationException,message=Error creating bean with name '.springframework.security.authenticationManager': Requested bean is currently in creation: Is there an unresolvable circular reference or an asynchronous initialization dependency?

Typically hundreds of such events all have the same parentId (which is just another spring.beans.instantiate of one of my beans).

I would like to learn how to understand this. How can spring log this problem and still work around it?

It looks like spring fails to create this bean many times, while still proceeding (my application starts fine).

I assume this is not the ideal flow of events: what can i do to investigate?

If this is an indication of the fact that i would have circular bean dependencies, how can i identify the beans involved in a circular dependency chain? I know adding @Lazy at specific points is a solution, but i don't know how to find the cycles.

Using

<.springframework.version>6.2.2</.springframework.version>
<.springframework.security.version>6.4.2</.springframework.security.version>

本文标签: