Spring Boot:应用程序无法启动

时间:2019-04-27 05:31:55

标签: spring-boot

想通过一些示例来学习Spring Boot。创建了一个简单的项目,没有进行任何其他更改。刚启动的Spring Boot应用程序成功启动后便会添加更多功能。但是服务器没有启动。下面是服务器日志:服务器没有启动。使用了JDK 8和spring boot 4.0版本。

o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 2671 ms
concurrent.ThreadPoolTaskExecutor  : Initializing ExecutorService 'applicationTaskExecutor'
org.apache.catalina.util.LifecycleBase   : 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.17.jar:9.0.17]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) ~[tomcat-embed-core-9.0.17.jar:9.0.17]
    at org.apache.catalina.core.StandardService.addConnector(StandardService.java:226) [tomcat-embed-core-9.0.17.jar:9.0.17]
    at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.addPreviouslyRemovedConnectors(TomcatWebServer.java:259) [spring-boot-2.1.4.RELEASE.jar:2.1.4.RELEASE]
    at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.start(TomcatWebServer.java:197) [spring-boot-2.1.4.RELEASE.jar:2.1.4.RELEASE]
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.startWebServer(ServletWebServerApplicationContext.java:311) [spring-boot-2.1.4.RELEASE.jar:2.1.4.RELEASE]
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.finishRefresh(ServletWebServerApplicationContext.java:164) [spring-boot-2.1.4.RELEASE.jar:2.1.4.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:552) [spring-context-5.1.6.RELEASE.jar:5.1.6.RELEASE]
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:142) [spring-boot-2.1.4.RELEASE.jar:2.1.4.RELEASE]
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775) [spring-boot-2.1.4.RELEASE.jar:2.1.4.RELEASE]
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) [spring-boot-2.1.4.RELEASE.jar:2.1.4.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:316) [spring-boot-2.1.4.RELEASE.jar:2.1.4.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260) [spring-boot-2.1.4.RELEASE.jar:2.1.4.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248) [spring-boot-2.1.4.RELEASE.jar:2.1.4.RELEASE]
    at com.discovery.SpringEcartServiceApplication.main(SpringEcartServiceApplication.java:10) [classes/:na]
Caused by: java.io.IOException: Unable to establish loopback connection
    at sun.nio.ch.PipeImpl$Initializer.run(PipeImpl.java:94) ~[na:1.8.0_211]
    at sun.nio.ch.PipeImpl$Initializer.run(PipeImpl.java:61) ~[na:1.8.0_211]
    at java.security.AccessController.doPrivileged(Native Method) ~[na:1.8.0_211]
    at sun.nio.ch.PipeImpl.<init>(PipeImpl.java:171) ~[na:1.8.0_211]
    at sun.nio.ch.SelectorProviderImpl.openPipe(SelectorProviderImpl.java:50) ~[na:1.8.0_211]
    at java.nio.channels.Pipe.open(Pipe.java:155) ~[na:1.8.0_211]
    at sun.nio.ch.WindowsSelectorImpl.<init>(WindowsSelectorImpl.java:127) ~[na:1.8.0_211]
    at sun.nio.ch.WindowsSelectorProvider.openSelector(WindowsSelectorProvider.java:44) ~[na:1.8.0_211]
    at java.nio.channels.Selector.open(Selector.java:227) ~[na:1.8.0_211]
    at org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector(NioSelectorPool.java:54) ~[tomcat-embed-core-9.0.17.jar:9.0.17]
    at org.apache.tomcat.util.net.NioSelectorPool.close(NioSelectorPool.java:109) ~[tomcat-embed-core-9.0.17.jar:9.0.17]
    at org.apache.tomcat.util.net.NioEndpoint.unbind(NioEndpoint.java:338) ~[tomcat-embed-core-9.0.17.jar:9.0.17]
    at org.apache.tomcat.util.net.AbstractEndpoint.bindWithCleanup(AbstractEndpoint.java:1108) ~[tomcat-embed-core-9.0.17.jar:9.0.17]
    at org.apache.tomcat.util.net.AbstractEndpoint.start(AbstractEndpoint.java:1189) ~[tomcat-embed-core-9.0.17.jar:9.0.17]
    at org.apache.coyote.AbstractProtocol.start(AbstractProtocol.java:568) ~[tomcat-embed-core-9.0.17.jar:9.0.17]
    at org.apache.catalina.connector.Connector.startInternal(Connector.java:1005) ~[tomcat-embed-core-9.0.17.jar:9.0.17]
    ... 14 common frames omitted
Caused by: java.net.ConnectException: Connection timed out: connect
    at sun.nio.ch.Net.connect0(Native Method) ~[na:1.8.0_211]
    at sun.nio.ch.Net.connect(Net.java:454) ~[na:1.8.0_211]
    at sun.nio.ch.Net.connect(Net.java:446) ~[na:1.8.0_211]
    at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:648) ~[na:1.8.0_211]
    at java.nio.channels.SocketChannel.open(SocketChannel.java:189) ~[na:1.8.0_211]
    at sun.nio.ch.PipeImpl$Initializer$LoopbackConnector.run(PipeImpl.java:127) ~[na:1.8.0_211]
    at sun.nio.ch.PipeImpl$Initializer.run(PipeImpl.java:76) ~[na:1.8.0_211]
    ... 29 common frames omitted

2019-04-27 10:40:09.166  INFO 6032 --- [           main] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
2019-04-27 10:40:09.232  INFO 6032 --- [           main] ConditionEvaluationReportLoggingListener : 

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.


***************************
APPLICATION FAILED TO START
***************************    
The Tomcat connector configured to listen on port 8080 failed to start. The port may already be in use or the connector may be mis-configured.

0 个答案:

没有答案