1. 报错信息
1 2 3 4 5 6 7 8 |
Description: The bean 'dataSource', defined in BeanDefinition defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class], could not be registered. A bean with that name has already been defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class] and overriding is disabled. Action: Consider renaming one of the beans or enabling overriding by setting spring.main.allow-bean-definition-overriding=true |
2. 原因
1 2 |
相同名字不成功 |
3. 解决办法
1 2 3 4 |
main: allow-bean-definition-overriding: true #当遇到同样名字的时候,是否允许覆盖注册 |
from:https://blog.csdn.net/weixin_42633131/article/details/84782516
View Details