springboot启动报错:"Error starting ApplicationContext. To display the conditions report re-run your application with ‘debug’ enabled."
开发工具: SpringToolSuite4(STS)
报错内容:
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2019-11-09 12:25:02.528 ERROR 1436 --- [ restartedMain] 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.
这是我们在pom.xml 加入了以下依赖
<dependency>
<groupId>org.mybatis.spring.boot</groupId>>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>2.1.1</version>
</dependency>
只要我们找到以下并且注释掉
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>2.1.1</version>
</dependency>
如图:
运行Application.java,如下图则成功: