【发布时间】:2018-05-03 05:45:26
【问题描述】:
当我尝试运行 spring boot 应用程序时,出现以下错误
starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. 2018-05-03 10:50:09.457 ERROR 4909 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :
*************************** APPLICATION FAILED TO START
***************************
Description:
Failed to auto-configure a DataSource: 'spring.datasource.url' is not specified and no embedded datasource could be auto-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).
【问题讨论】:
-
你的 pom.xml 中是否包含
spring-boot-starter-data-jpa?它将假定您将处理数据存储。 -
请发布您的 pom 或 gradle 文件的 sn-p 以及您的 application.properties
-
您是否在 application.properties 或 yml 文件中包含
spring.datasource.url?
标签: spring-boot