Springboot异常--Identify and stop the process that‘s listening on port 9090 or configure this applicat

Posted 一只楠喃

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Springboot异常--Identify and stop the process that‘s listening on port 9090 or configure this applicat相关的知识,希望对你有一定的参考价值。

刚开始入门Springboot运行一些入门案例时遇到的bug

下面是异常信息:

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2021-10-19 09:22:12.836 ERROR 5368 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 
***************************
APPLICATION FAILED TO START
***************************

Description:

Web server failed to start. Port 9090 was already in use.

Action:

Identify and stop the process that's listening on port 9090 or configure this application to listen on another port.

2021-10-19 09:22:12.838  INFO 5368 --- [           main] o.s.s.concurrent.ThreadPoolTaskExecutor  : Shutting down ExecutorService 'applicationTaskExecutor'

异常截图:

异常是因为我使用的端口9090被占用,是一个入门时很容易遇到的异常

Identify and stop the process that’s listening on port 9090 or configure this applicat

正经翻译:确定并停止正在端口9090上侦听的进程,或将此应用程序配置为在另一个端口上侦听。
人话:你9090端口被占用了,你要不杀掉,要不改个端口

解决办法:

  1. 我给Springboot的端口是9090,那现在我想要让它的端口不是9090,而是9091,或者说另一个项目占用了9090,需要我们把现在的项目改成9091,那么我们就可以在application.properties文件中修改server.port=9091

再运行你看他就变量了
在运行时也改成9091

  1. 杀掉这个端口
    1. netstat -ano
      win+r打开运行,并输入cmd

      输入netstat -ano

      然后一回车!就出来巨多端口

      然后你找到9090

      记住对应的17832

输入taskkill /pid 17832 -f 杀掉端口

然后就杀掉了

  1. netstat -aon|findstr “9090”
    直接输入netstat -aon|findstr "9090"并回车

    输入taskkill /pid 17832 -f 杀掉端口
    然后就杀掉了

以上是关于Springboot异常--Identify and stop the process that‘s listening on port 9090 or configure this applicat的主要内容,如果未能解决你的问题,请参考以下文章

springboot 异常: Requested bean is currently in creation: Is there an unresolvable circular reference?

tomcat 启动 证书异常java.io.IOException: Alias name [cas] does not identify a key entry

SpringBoot 2.x 统一异常处理

Thymeleaf 异常:Exception processing template "index": An error happened during template pars

javax.persistence.TransactionRequiredException: Executing an update/delete query

Springboot+作业框架