解决Action: Consider the following: If you want an embedded database (H2, HSQL or Derby), ple..
                                                            生活随笔
收集整理的這篇文章主要介紹了
                                解决Action: Consider the following: If you want an embedded database (H2, HSQL or Derby), ple..
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.                        
                                問題
springboot異常Action: Consider the following: If you want an embedded database (H2, HSQL or Derby), please put i…
 **
解釋:
**在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
@EnableAutoConfiguration(exclude={DataSourceAutoConfiguration.class})總結
以上是生活随笔為你收集整理的解决Action: Consider the following: If you want an embedded database (H2, HSQL or Derby), ple..的全部內容,希望文章能夠幫你解決所遇到的問題。
 
                            
                        - 上一篇: springboot报错---@RunW
- 下一篇: Error creating bean
