spring service层循环引用问题

可以在service中添加@lazy(true)---实测有效。例如:

public class AService{

@Autowired
@Lazy(true)
private BService bService;

}


public class BService{

@Autowired
@Lazy(true)
private AService aService;

}
posted @ 2024-02-01 17:39  盘思动  阅读(84)  评论(0)    收藏  举报