详细报错:
2021-03-16 19:19:56,647 ERROR org.apache.juli.logging.DirectJDKLog 175 log - Failed to start component [Connector[HTTP/1.1-8080]] org.apache.catalina.LifecycleException: Protocol handler start failed
at org.apache.catalina.connector.Connector.startInternal(Connector.java:1008) ~[tomcat-embed-core-9.0.21.jar:9.0.21]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) [tomcat-embed-core-9.0.21.jar:9.0.21]
at org.apache.catalina.core.StandardService.addConnector(StandardService.java:227) [tomcat-embed-core-9.0.21.jar:9.0.21]
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.addPreviouslyRemovedConnectors(TomcatWebServer.java:263) [spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.start(TomcatWebServer.java:195) [spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.startWebServer(ServletWebServerApplicationContext.java:296) [spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.finishRefresh(ServletWebServerApplicationContext.java:162) [spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:552) [spring-context-5.1.8.RELEASE.jar:5.1.8.RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140) [spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:742) [spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:389) [spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:311) [spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1213) [spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1202) [spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
at com.xyx.tmall.TmallSpringBootApplication.main(TmallSpringBootApplication.java:31) [classes/:?]
Caused by: java.net.BindException: Address already in use: bind
at sun.nio.ch.Net.bind0(Native Method) ~[?:1.8.0_144]
at sun.nio.ch.Net.bind(Net.java:433) ~[?:1.8.0_144]
at sun.nio.ch.Net.bind(Net.java:425) ~[?:1.8.0_144]
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223) ~[?:1.8.0_144]
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74) ~[?:1.8.0_144]
at org.apache.tomcat.util.net.NioEndpoint.initServerSocket(NioEndpoint.java:230) ~[tomcat-embed-core-9.0.21.jar:9.0.21]
at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:213) ~[tomcat-embed-core-9.0.21.jar:9.0.21]
at org.apache.tomcat.util.net.AbstractEndpoint.bindWithCleanup(AbstractEndpoint.java:1124) ~[tomcat-embed-core-9.0.21.jar:9.0.21]
at org.apache.tomcat.util.net.AbstractEndpoint.start(AbstractEndpoint.java:1210) ~[tomcat-embed-core-9.0.21.jar:9.0.21]
at org.apache.coyote.AbstractProtocol.start(AbstractProtocol.java:585) ~[tomcat-embed-core-9.0.21.jar:9.0.21]
at org.apache.catalina.connector.Connector.startInternal(Connector.java:1005) ~[tomcat-embed-core-9.0.21.jar:9.0.21]
... 14 more
2021-03-16 19:19:56,703 INFO org.apache.juli.logging.DirectJDKLog 173 log - Pausing ProtocolHandler ["http-nio-8080"]
2021-03-16 19:19:56,704 INFO org.apache.juli.logging.DirectJDKLog 173 log - Stopping service [Tomcat]
2021-03-16 19:19:56,725 INFO org.apache.juli.logging.DirectJDKLog 173 log - The stop() method was called on component [StandardServer[-1]] after stop() had already been called. The second call will be ignored.
2021-03-16 19:19:56,726 INFO org.apache.juli.logging.DirectJDKLog 173 log - Stopping ProtocolHandler ["http-nio-8080"]
2021-03-16 19:19:56,728 INFO org.apache.juli.logging.DirectJDKLog 173 log - Destroying ProtocolHandler ["http-nio-8080"]
2021-03-16 19:19:56,738 INFO org.springframework.boot.autoconfigure.logging.ConditionEvaluationReportLoggingListener 135 logMessage -
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2021-03-16 19:19:56,755 ERROR org.springframework.boot.diagnostics.LoggingFailureAnalysisReporter 40 report -
***************************
APPLICATION FAILED TO START
***************************
Description:
The Tomcat connector configured to listen on port 8080 failed to start. The port may already be in use or the connector may be misconfigured.
Action:
Verify the connector's configuration, identify and stop any process that's listening on port 8080, or configure this application to listen on another port.
2021-03-16 19:19:56,767 INFO org.springframework.scheduling.concurrent.ExecutorConfigurationSupport 208 shutdown - Shutting down ExecutorService 'applicationTaskExecutor'
问题:该报错明显是8080端口被占用导致报错
解决方法:
- Windows 杀死8080端口进程
- 配置其他端口:
如果是普通的maven项目修改tomcat配置的端口
如果是springboot项目,修改application.properties配置文件中配置的端口号即可