
SpringBoot
JefferyC2018
不屈为至贵,最富是清贫
展开
-
Failed to determine a suitable driver class
Failed to determine a suitable driver class 这是因为添加了数据库组件,所以autoconfig会去读取数据源配置,而新建的项目还没有配置数据源/URL地址错误,所以会导致异常出现。 解决方案: 一。 在启动类的@EnableAutoConfiguration或@SpringBootApplication中添加exclude = {DataSourceAutoConfiguration.class},排除此类的autoconfig。启动以后就可以正常运原创 2021-10-03 19:53:45 · 604 阅读 · 0 评论 -
SpringBoot 的 CommandLineRunner接口
SpringBoot的CommandLineRunner接口,作为SpringBoot启动后的接口回调。可以将系统一些数据初始化,放入其中; import org.springframework.boot.CommandLineRunner; import org.springframework.core.annotation.Order; import org.springframework...原创 2019-04-06 17:35:05 · 147 阅读 · 0 评论