tomcat中的java springboot循环依赖
我负责一个非常老的项目,它确实有一个循环依赖关系
----这是密码public class BService{
@Autowired
private AService aService;
}
与此同时
public class AService{
@Autowired
private BService bService;
}
最奇怪的事情发生了,我用springboot(嵌入tomcat)运行,它可以像往常一样运行。 在我将其打包(顺便说一句,我将主应用程序和pom以及提供的tomcat和排除嵌入的tomcat)后,将其更改为war
当我把它部署到tomcat上时
***************************
APPLICATION FAILED TO START
***************************
Description:
The dependencies of some of the beans in the application context form a cycle:
| xxxx.xxx.aService
| xxxx.xxxx.bService
这是我的问题
前提是,我不能更改代码
- 为什么在使用嵌入式tomcat时可以像往常一样运行它
- 为什么在我将tomcat打包为war并部署时,它会在tomcat中显示循环依赖关系
共 (0) 个答案