解决The bean ‘dataSource‘, defined in BeanDefinition defined in class path resource 问题

在启动springboot+springcloud项目时遇到错误,bean 'dataSource'注册失败。解决方案是在配置文件中添加`spring.main.allow-bean-definition-overriding=true`,但根本原因是SpringBoot和SpringCloud版本不兼容。降低版本到合适组合可以解决问题,强调技术选型时要考虑组件兼容性。
摘要由CSDN通过智能技术生成

前言

今天在启动springboot+springcloud项目的时候,发现报一个错误 如下错误

Error starting ApplicationContext. To display the conditions report re-run your application with ‘debug’ enabled.
2020-09-17 16:34:52.056 ERROR 19128 — [ 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 H i k a r i . c l a s s ] , c o u l d n o t b e r e g i s t e r e d . A b e a n w i t h t h a t n a m e h a s a l r e a d y b e e n d e f i n e d i n c l a s s

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值