A bean with that name has already been defined in DataSourceConfiguration$Hikari.class

A bean with that name has already been defined in DataSourceConfiguration$Hikari.class

构建springcloud的时候一定要注意起微服务的版本 不然会报上面的错误

原因:
SpringBoot和SpringCloud的版本不兼容造成。
这里因为SpringBoot想尝鲜使用了2.1.0,而SpringCloud仍然用的是Finchley.SR2,而它支持的是2.0.x及以下版本。
对应的版本应该使用Greenwich.M1。
Issues回答:

 

解决:
降SpringBoot版本或者使用Greenwich.M1。
所以还是建议直接在start.spring.io上构建新项目,或者在idea上构建项目的时候选择Spring Initializr来避免版本不兼容。
---------------------
作者:Orcas阿晨
来源:CSDN
原文:https://blog.csdn.net/u012211603/article/details/83714285
版权声明:本文为博主原创文章,转载请附上博文链接!

原文地址:https://www.cnblogs.com/zengpeng/p/10208656.html