springboot简单报错处理
**Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.2.2.RELEASE:run (default-cli) on project springboottest1: Application finished with exit code: 1
**
这种原因是创建项目的时候加入了jdbc的依赖,也就是数据库的数据源,但没配这个数据库
-
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-jdbc</artifactId> </dependency>
解决方法
在注解@SpringBootApplication后面加入
(exclude = {DataSourceAutoConfiguration.class})该语句含义为
取消数据库配置,我们要用到数据库时要去掉这句话,不然会报错