Reason: Failed to determine a suitable driver class错误分析

本文记录了一次SpringBoot应用启动失败的排查经历,错误原因为数据源配置不当,具体表现为未指定URL及未能确定合适的驱动类。通过检查application配置、数据库设置及pom文件依赖引入,发现druid依赖引入错误。文章提供了正确的解决方案,并指出无需遵循某些网上建议的操作。

在这里插入图片描述

Error starting ApplicationContext. To display the conditions report re-run your application with ‘debug’ enabled.
2020-03-29 15:01:42.227 ERROR 9172 — [ restartedMain] o.s.b.d.LoggingFailureAnalysisReporter :


APPLICATION FAILED TO START


Description:

Failed to configure a DataSource: ‘url’ attribute is not specified and no embedded datasource could be configured.

Reason: Failed to determine a suitable driver class

Action:

Consider the following:
If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).

Process finished with exit code 1
【错误原因】:数据源出现错误
【排查】:①application中url地址
②数据库配置
③pom文件中依赖的引入
我的错误原因在于druid依赖引入错误
正确:
在这里插入图片描述
错误:
在这里插入图片描述
【注】:druid数据源中有spring
同时网上有的让注释掉mybaties依赖的和在启动类中添加注解的,我这个没有按照网上的操作照常运行
mybaties保留在这里插入图片描述
在这里插入图片描述

评论 36
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值