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中引入的类也有自己的启动类和配置文件。 所以要注意依赖里只可引入工具类或实体类,避免冲突。
经验分享 程序员 微信小程序 职场和发展