首页 » 文章 » spring boot 升级到2.1.0 报错

昨天把spring boot升级到2.1.0版本,但是报错如下


***************************
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版本不兼容,更改如下:


<spring-cloud.version>Finchley.SR1</spring-cloud.version>
改成
<spring-cloud.version>Greenwich.M1</spring-cloud.version>

但是spring boot 2.1 和Greenwich.M1搭配仍然有部分问题,有人建议用2.1的snapshot版本,考虑稳定性问题,我有回退到2.0.6 + Finchley.SR1 了,可以看出spring boot是用版本的第二个数字保证兼容性的。

添加新评论