这篇文章上次修改于 2206 天前,可能其部分内容已经发生变化,如有疑问可询问作者。 ### 昨天把spring boot升级到2.1.0版本,但是报错如下 ```java *************************** APPLICATION FAILED TO START *************************** 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 ``` ### 查了下,原来和spring cloud版本不兼容,更改如下: ``` xml Finchley.SR1 改成 Greenwich.M1 ``` ### 但是spring boot 2.1 和Greenwich.M1搭配仍然有部分问题,有人建议用2.1的snapshot版本,考虑稳定性问题,我有回退到2.0.6 + Finchley.SR1 了,可以看出spring boot是用版本的第二个数字保证兼容性的。
没有评论