Caused by: org.springframework.beans.factory.support.BeanDefinitionOverrideException: Invalid bean definition with name 'dataSource'?defined in class path resource [org/apache/shardingsphere/shardingjdbc/spring/boot/SpringBootConfiguration.class]:?Cannot register bean definition [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3;? dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.apache.shardingsphere.shardingjdbc.spring.boot.SpringBootConfiguration;?
factoryMethodName=dataSource; initMethodName=null; destroyMethodName=(inferred); defined in class path resource? [org/apache/shardingsphere/shardingjdbc/spring/boot/SpringBootConfiguration.class]] for bean 'dataSource': There is already [Root bean: class [null];? scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0;? autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.autoconfigure.jdbc.DataSourceConfiguration$Hikari;? factoryMethodName=dataSource; initMethodName=null; destroyMethodName=(inferred);? defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]] bound.
在配置文件使用bean的覆盖配置:
spring.main.allow-bean-definition-overriding=true
|