springboot解决循环依赖
import org.springframework.context.annotation.Lazy;
@Service
public class CService {
private AService aService; // 去掉@Autowired
// 采用构造器方式,加入Lazy注解
public CService(@Lazy AService aService) {
this.aService = aService;
}
}

浙公网安备 33010602011771号