Error starting ApplicationContext. To display the auto-configuration report re-run your application
异常信息
Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
2019-01-22 15:47:42.208 ERROR 5508 --- [ 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
原因是:springboot启动时会自动注入数据源和配置jpa
解决:在@SpringBootApplication中排除其注入
需要在启动类的@EnableAutoConfiguration或@SpringBootApplication中添加exclude = {DataSourceAutoConfiguration.class}