Failed to determine a suitable driver class

Background

SpringBoot 启动不成功

报错信息

2022-09-23 14:09:31 [main] INFO org.springframework.boot.autoconfigure.logging.ConditionEvaluationReportLoggingListener -

Error starting ApplicationContext. To display the conditions report re-run your application with ‘debug’ enabled.
2022-09-23 14:09:31 [main] ERROR org.springframework.boot.diagnostics.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

原因

Spring 没找着配置文件,
target里没有配置文件

解决

改成 yml -> yaml 后 target 里有了


版权声明:本文为Enchanter06原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。