Spring Boot不使用数据库遇到—Cannot determine embedded database driver class for database type NONE问题以及解决方案
1.原因:
Spring Boot在启动时会自动注入数据源和jpa配置
Cannot determine embedded database driver class for database type NONE
2.解决方案
在@SpringBootApplication
中后加入其注入如下:
@SpringBootApplication(exclude={DataSourceAutoConfiguration.class,HibernateJpaAutoConfiguration.class})
3.启动方式
springboot启动后默认没有带项目路径,访问:http://127.0.0.1:8080/hello