在使用Intellij Idea调试时,以Application方式启动程序时提示:
1 | 2016-10-17 11:28:38.537 ERROR 23156 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter : |
提示8080端口已经被占用了,由于此时是以Application方式启动的,没有Tomcat的相关端口配置。Spring Boot uses embedded Tomcat by default, but it handles it differently without using tomcat-maven-plugin. To change the port use –server.port parameter for example。添加程序启动参数:--server.port=8181
,更改嵌入的Tomcat的端口即可解决此问题。如图所示:
解决方案来自StackOverflow:
[Launching Spring application Address already in use]
[Launching Spring application Address already in use]:http://stackoverflow.com/questions/20735205/launching-spring-application-address-already-in-use