org.springframework.boot.web.embedded.tomcat.ConnectorStartFailedException: Connector configured to listen on port 808 failed to start

刘超 12天前 ⋅ 82 阅读   编辑

一、描述

  启动springboot,报如下错误

2021-01-11 21:28:01.772 DEBUG 2660 --- [  restartedMain] o.s.b.d.LoggingFailureAnalysisReporter   : Application failed to start due to an exception

org.springframework.boot.web.embedded.tomcat.ConnectorStartFailedException: Connector configured to listen on port 808 failed to start
	at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.checkThatConnectorsHaveStarted(TomcatWebServer.java:228) ~[spring-boot-2.0.4.RELEASE.
jar:2.0.4.RELEASE]
	at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.start(TomcatWebServer.java:203) ~[spring-boot-2.0.4.RELEASE.jar:2.0.4.RELEASE]
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.startWebServer(ServletWebServerApplicationContext.java:300) ~[spri
ng-boot-2.0.4.RELEASE.jar:2.0.4.RELEASE]
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.finishRefresh(ServletWebServerApplicationContext.java:162) ~[sprin
g-boot-2.0.4.RELEASE.jar:2.0.4.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:553) ~[spring-context-5.0.8.RELEASE.jar:5.0
.8.RELEASE]
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140) ~[spring-boot
-2.0.4.RELEASE.jar:2.0.4.RELEASE]
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:762) [spring-boot-2.0.4.RELEASE.jar:2.0.4.RELEASE]
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:398) [spring-boot-2.0.4.RELEASE.jar:2.0.4.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:330) [spring-boot-2.0.4.RELEASE.jar:2.0.4.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1258) [spring-boot-2.0.4.RELEASE.jar:2.0.4.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1246) [spring-boot-2.0.4.RELEASE.jar:2.0.4.RELEASE]
	at mblog.BootApplication.main(BootApplication.java:18) [classes/:na]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_111]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_111]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_111]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_111]
	at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49) [spring-boot-devtools-2.0.4.RELEASE.jar:2.0.4.RELEASE]

二、分析

  1、上述错误信息描述十分具有迷惑性,找遍了机器,也没找到808端口被占用,当然这也是经验主义作祟,其实消息内也提示了可能配置信息有误,只是没有注意到。最后在排查application.properties配置文件的时候才发现是key-store文件的位置写错了

server.ssl.key-store: key.p12

  而文档中给出的是:

server.ssl.key-store:classpath:/key.p12

  没有加入classpath,应用默认就回去当前启动位置所在的文件夹去找key store,当然找不到了

  2、检查server.ssl.key-store-password是否正确

三、解决方法

  server.ssl.key-store地址是否正确;检查server.ssl.key-store-password是否正确;

四、参考文章
  1、https://blog.csdn.net/stanleyw2014/article/details/96481028


注意:本文归作者所有,未经作者允许,不得转载

全部评论: 0

    我有话说: