更多精彩关注微信公众号

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 ne

 

 

 

错误原因

在pom中引入了mybatis-spring-boot-starter ,Spring boot默认会加载org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration类,DataSourceAutoConfiguration类使用了@Configuration注解向spring注入了dataSource bean。因为工程中没有关于dataSource相关的配置信息,当spring创建dataSource bean因缺少相关的信息就会报错。
解决错误
在Spring boot的启动引导类上增加@EnableAutoConfiguration(exclude={DataSourceAutoConfiguration.class}),阻止Spring boot自动注入dataSource

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 ne

 

推荐阅读:

IntelliJ IDEA打开Maven项目,Spring boot所有依赖红名,不可用

 IDEA 导入Springboot 项目

创建Maven项目,GroupId和Artifact Id该如何填写?

问:hibernate的sessionfactory是干嘛的?session又是干嘛的呢?

 

 

 

相关文章:

  • 2021-06-11
  • 2021-04-27
  • 2021-07-04
  • 2021-06-10
  • 2021-08-08
  • 2022-12-23
  • 2022-12-23
  • 2021-09-28
猜你喜欢
  • 2022-12-23
  • 2021-05-20
  • 2021-05-13
  • 2022-12-23
相关资源
相似解决方案