Summary

when I use UserDetailsManager‘s changePassword function,i found there is an unresolvable circular reference,I dont kown how to solve these

Actual Behavior

received a exception

Caused by: org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'org.springframework.security.authenticationManager': Requested bean is currently in creation: Is there an unresolvable circular reference?
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.beforeSingletonCreation(DefaultSingletonBeanRegistry.java:347)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:351)

Expected Behavior

startup normally

Configuration

   <authentication-manager alias="authenticationManager">
        <authentication-provider user-service-ref="userDetailsManager">
            <password-encoder ref="passwordEncoder"/>
        </authentication-provider>
    </authentication-manager>

 <beans:bean name="userDetailsManager"  class="org.springframework.security.provisioning.JdbcUserDetailsManager" lazy-init="true">
        <beans:property name="dataSource" ref="dataSource"/>
        <beans:property name="authenticationManager" ref="authenticationManager"/>
    </beans:bean>

Version

4.1.3.RELEASE

Sample

Comment From: rwinch

Thanks for the report! Can you provide a sample that reproduces this behavior? Without it, I don't think we can provide much help

Comment From: lmtoo

@rwinch I have uploaded the demo and the address is https://github.com/lmtoo/security-demos/tree/master/Xml

Comment From: spring-projects-issues

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.