问题描述
问题原因
在启动项目时,createRestApi这个Bean已经存在,不能被注册。导致启动失败。
解决方案
目前想到的解决办法有两个,方案1和方案2
方案1:重新命名
重新命名这个实例,例如本此问题把这个(appCofig)名字改为另一个名字即可。
方案2:修改配置文件
1:yml格式:
#当出现相同名字的类进行注册时,准许覆盖注册 spring: main: allow-bean-definition-overriding: true
2.properties格式
#当出现相同名字的类进行注册时,准许覆盖注册 spring.main.allow-bean-definition-overriding=true