Springboot启动报错:Cannot determine embedded database driver class for database type

 问题:启动springboot报错

报错信息如下:

Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
2017-07-13 22:59:26.567 ERROR 15380 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   :

***************************
APPLICATION FAILED TO START
***************************

Description:

Cannot determine embedded database driver class for database type NONE

Action:

If you want an embedded database please put a supported one on the classpath. If you have database settings to be loaded from a particular profile you may need to active it (no profiles are currently active).


Process finished with exit code 1

解决:在main入口时声明

@SpringBootApplication(exclude={DataSourceAutoConfiguration.class,HibernateJpaAutoConfiguration.class})


原因:Springboot启动时会自动注入数据源和jpa而项目中没有配置

1 启动时把相关信息过滤掉

2 添加相关信息配置

好久没更啦

共勉

猜你喜欢

转载自1158023912.iteye.com/blog/2384408