启动时出现错误,Failed to configure a DataSource

来源:6-1 关于红包收发之操作数据库(上)

慕神8002718

2019-08-19

Error starting ApplicationContext. To display the conditions report re-run your application with ‘debug’ enabled.
2019-08-19 17:02:05.104 ERROR 30416 — [ main] 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).

写回答

1回答

皮皮c

2019-08-20

可能是这个原因 详见https://coding.imooc.com/learn/questiondetail/126266.html

0
2
乃好
回复
慕神8002718
在springboot启动类的注解上修改 @SpringBootApplication(exclude= {DataSourceAutoConfiguration.class}) 试试看行不行
2019-08-23
共2条回复

2小时快速上手Spring Boot

一切为了效率!两个小时学习SpringBoot,为你省时省力Get干货

11582 学习 · 249 问题

查看课程