SpringBoot | SpringBoot启动错误

时间:2021-02-18 14:46:35
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.

  

原因:

  springboot启动时会自动注入数据源和配置jpa 
解决:

  在@SpringBootApplication中排除其注入  exclude={DataSourceAutoConfiguration.class,HibernateJpaAutoConfiguration.class}

//@SpringBootApplication
@SpringBootApplication(exclude={DataSourceAutoConfiguration.class,HibernateJpaAutoConfiguration.class})
public class CreditApplication {
public static void main(String[] args) {
SpringApplication.run(CreditApplication.class, args);
}
}