Open vibhanshujha opened 2 years ago
I am also getting this same issue.
Hi Try removing @Autowired annotation and creating the following code snippet from userServiceImpl. It helps in tackling the circular dependency error. @Lazy-> it initializes it lazily only when called and helps in tackling the issue.
private UserReopsitory userReopsitory;
public UserServiceImpl( @Lazy UserReopsitory userReopsitory) {
super();
this.userReopsitory = userReopsitory;
}
The dependencies of some of the beans in the application context form a cycle:
┌─────┐ | securityConfiguration (field private com.themechguy.registrationpage.service.UserService com.themechguy.registrationpage.config.SecurityConfiguration.userServices) ↑ ↓ | userServiceImpl (field private org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder com.themechguy.registrationpage.service.UserServiceImpl.passwordEncoder) └─────┘