Spring Boot 中的Tomcat启动多次

org.apache.catalina.LifecycleException: Failed to start component [Connector[HTTP/1.1-8980]]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)
    at org.apache.catalina.core.StandardService.addConnector(StandardService.java:225)
    at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.addPreviouslyRemovedConnectors(TomcatEmbeddedServletContainer.java:250)
    at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.start(TomcatEmbeddedServletContainer.java:193)
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.startEmbeddedServletContainer(EmbeddedWebApplicationContext.java:297)
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.finishRefresh(EmbeddedWebApplicationContext.java:145)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:546)
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122)
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693)
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:303)
    at com.jeesite.modules.config.Application.main(Application.java:24)
Caused by: org.apache.catalina.LifecycleException: Protocol handler start failed
    at org.apache.catalina.connector.Connector.startInternal(Connector.java:1021)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    ... 11 common frames omitted
Caused by: java.net.BindException: Address already in use: bind
    at sun.nio.ch.Net.bind0(Native Method)
    at sun.nio.ch.Net.bind(Net.java:433)
    at sun.nio.ch.Net.bind(Net.java:425)
    at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)
    at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
    at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:210)
    at org.apache.tomcat.util.net.AbstractEndpoint.start(AbstractEndpoint.java:1150)
    at org.apache.coyote.AbstractProtocol.start(AbstractProtocol.java:591)
    at org.apache.catalina.connector.Connector.startInternal(Connector.java:1018)
    ... 12 common frames omitted

 

 

 

解决方案:不知道怎么回事在Spring Boot中将Tomcat启动了多次,将服务器停止后,仍然能够访问页面,之后将eclipse退出,重进,重新启动Tomcat,问题解决

展开阅读全文

没有更多推荐了,返回首页