报错如下:
***************************
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).
根因分析:
这个报错的原因非常多。
springboot启动时会自动注入数据源和配置jpa
解决办法:在@SpringBootApplication中排除其注入
@SpringBootApplication(exclude={DataSourceAutoConfiguration.class,HibernateJpaAutoConfiguration.class})
这个方法是暴力的干掉了数据库连接, 这是不可能, 因为用框架写代码不可能不连接数据库的。
原文地址:https://www.cnblogs.com/geektcp/p/12299829.html
时间: 2024-11-06 03:50:13