解决:The Tomcat connector configured to listen on port 8182 failed to start. The port may already be i...

错误信息:

org.apache.catalina.LifecycleException: Protocol handler start failed
	at org.apache.catalina.connector.Connector.startInternal(Connector.java:1008)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
	at org.apache.catalina.core.StandardService.addConnector(StandardService.java:227)
	at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.addPreviouslyRemovedConnectors(TomcatWebServer.java:263)
	at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.start(TomcatWebServer.java:195)
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.startWebServer(ServletWebServerApplicationContext.java:297)
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.finishRefresh(ServletWebServerApplicationContext.java:163)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:552)
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141)
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:744)
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:391)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:312)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1204)
	at com.uminton.AccountServerApplication.main(AccountServerApplication.java:18)
Caused by: java.net.BindException: Cannot assign requested address: 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.initServerSocket(NioEndpoint.java:230)
	at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:213)
	at org.apache.tomcat.util.net.AbstractEndpoint.bindWithCleanup(AbstractEndpoint.java:1124)
	at org.apache.tomcat.util.net.AbstractEndpoint.start(AbstractEndpoint.java:1210)
	at org.apache.coyote.AbstractProtocol.start(AbstractProtocol.java:585)
	at org.apache.catalina.connector.Connector.startInternal(Connector.java:1005)
	... 14 common frames omitted

2020-03-12 10:55:15.011  INFO o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
2020-03-12 10:55:15.028  INFO ConditionEvaluationReportLoggingListener : 

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2020-03-12 10:55:15.034 ERROR o.s.b.d.LoggingFailureAnalysisReporter   : 

***************************
APPLICATION FAILED TO START
***************************

Description:

The Tomcat connector configured to listen on port 8182 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 8182, or configure this application to listen on another port.

 

主要看最下面的错误大致意思是(google翻译~~):

描述:

配置为监听端口8081的Tomcat连接器启动失败。端口可能已经在使用中,或者连接器可能配置错误。

行动:

验证连接器的配置,识别并停止在端口8081上侦听的任何进程,或者将此应用程序配置为在另一个端口上侦听。

解决端口被占用方法;

方法一:

 1.打开cmd命令窗口  输入如下指令查看所有端口和PID

netstat -ano

 2.找到对应的端口对应的PID  输入指令找到对应的进程

netstat -nao|findstr 8182

 3.杀掉该进程 再次启动就OK啦

 taskkill /f /t /im java.exe #或者  javaw.exe

方法二:

跟方法一的步骤一一样:先查找除对应被占用端口的PID

然后打开任务管理器,查找对应PID进程,结束任务即可

解决:The Tomcat connector configured to listen on port 8182 failed to start. The port may already be i..._第1张图片

 

方法三:简单粗暴

打开application.properties更改端口,用一个没被占用的端口 server.port=8080

 

补充:

  如果你application.properties配置了 server.address 配置的ip和本机ip不一样,也会报上面的错误

(刚换了ip忘了改,改了端口,被坑了好久~~)

 

你可能感兴趣的:(解决:The Tomcat connector configured to listen on port 8182 failed to start. The port may already be i...)