问题:
启动SpringBoot项目报错:
***************************
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
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2019-01-11 10:55:38.248 ERROR 12708 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :
***************************
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
Process finished with exit code 1
原因:
SpringBoot和SpringCloud的版本不兼容造成。
这里因为SpringBoot想尝鲜使用了2.1.1,而SpringCloud仍然用的是Finchley.SR2,而它支持的是2.0.x及以下版本。
对应的版本应该使用Greenwich.M1。
Issues回答:
解决:
降SpringBoot版本或者使用Greenwich.M1。
所以还是建议直接在start.spring.io上构建新项目,或者在idea上构建项目的时候选择Spring Initializr来避免版本不兼容。
---------------------
原文:https://blog.csdn.net/u012211603/article/details/83714285
本文详细解析了启动SpringBoot项目时报错“APPLICATION FAILED TO START”的原因,主要是由于SpringBoot与SpringCloud版本不兼容导致。文章提供了具体的错误信息,并提出了解决方案:调整SpringBoot版本或使用兼容的SpringCloud版本。
3145

被折叠的 条评论
为什么被折叠?



