Spring Boot 常见问题以及解决方案

  1. 报database type NONE 异常
Cannot determine embedded database driver class for database type NONE

原因是:springboot启动时会自动注入数据源和配置jpa
解决:在@SpringBootApplication中排除其注入

@SpringBootApplication(exclude={DataSourceAutoConfiguration.class,HibernateJpaAutoConfiguration.class})
@ComponentScan("cn.vcyber.www.web")
public class Application {
    public static void main(String[] args){
        SpringApplication.run(Application.class, args);
    }
}

你可能感兴趣的:(SpringBoot)