Failed to determine a suitable driver class

Posted Connection Reset

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Failed to determine a suitable driver class相关的知识,希望对你有一定的参考价值。

项目场景:

微服务项目中,多个项目互相调用时,出现


Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
//无法配置数据库,没有指定url属性,并且无法配置embedded datasource
Reason: Failed to determine a suitable driver class
//原因:无法明确指定正确的驱动类(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).


问题描述

 程序启动失败,缺乏合适的启动项


解决方案:

        pom文件中依赖冲突,当前类有自己的启动类,application.yml文件。但是pom中引入的类也有自己的启动类和配置文件。

        所以要注意依赖里只可引入工具类或实体类,避免冲突。

SpringBoot启动报错Failed to determine a suitable driver class

以上是关于Failed to determine a suitable driver class的主要内容,如果未能解决你的问题,请参考以下文章

SpringBoot启动异常:Reason: Failed to determine a suitable driver class

SpringBoot启动报错Failed to determine a suitable driver class

SpringBoot启动报错Failed to determine a suitable driver class

SpringBoot - Failed to determine a suitable driver class

Failed to determine a suitable driver class

Springboot启动报错:Failed to determine a suitable driver class