Spring Boot创建完项目运行Cannot determine embedded database driver class for database type NONE

spring boot 创建项目引用mybatis后,直接运行会提示:

Cannot determine embedded database driver class for database type NONE

因为springboot启动时会自动注入数据源

使用@SpringBootApplication注解排除注入即可

@SpringBootApplication(exclude={DataSourceAutoConfiguration.class})
public class Application {
    public static void main(String[] args){
        SpringApplication.run(Application.class, args);
    }
}

 

posted @ 2020-12-08 16:55  dcrenl  阅读(68)  评论(0编辑  收藏  举报