创建一个SpringBoot项目之后,控制台打印如下:
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.1.1.RELEASE)
2019-01-09 21:10:41.812 INFO 11644 --- [main] com.example.demo01.Demo01Application: Starting Demo01Application on 20180528-132245 with PID 11644 (D:\SpringBoot\project\demo01\target\classes started by Administrator in D:\SpringBoot\project\demo01)
2019-01-09 21:10:41.821 INFO 11644 --- [main] com.example.demo01.Demo01Application: No active profile set, falling back to default profiles: default
2019-01-09 21:10:43.160 INFO 11644 --- [main] com.example.demo01.Demo01Application: Started Demo01Application in 1.955 seconds (JVM running for 3.395)
Process finished with exit code 0
原因:创建的pom.xml有问题,
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
pom文件中有这个依赖,这个是什么意思呢?
简单来说就是:我把外部的一个tomcat引入了。
这下你明白了吧,spring boot内部本来就有一个。你现在又引入了一个,这下出问
解决方案:上述代码删掉,重新Import changes就Ok了