[Spring] Web server failed to start. Port 8080 was already in use.

하스레·2022년 9월 19일
0
post-thumbnail

오류 설명

어플리케이션을 Run했더니 다음과 같은 에러가 발생했다.

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. 
2022-09-20 00:31:09.084 ERROR -- [ restartedMain ] o.s.b.d.LoggingFailureAnalysisReporter - 

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

Description:

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

Action:

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

Process finished with exit code 0

오류 원인

에러를 읽어보면 이미 8080 포트가 사용중이라는 것을 알 수 있다.

오류 해결

  1. 터미널 접속후 해당 포트를 확인한다.
$ sudo lsof -i :8080


8080 포트에서 프로세스 아이디가 18093인 프로세스가 실행되고있음을 알 수 있다.

  1. 포트에서 작동하고있는 프로세스를 죽인다.
$ sudo kill -9 18093

이후 다시 스프링에서 어플리케이션을 실행하면 잘 작동되는 것을 확인할 수 있다.


참고
https://zincod.tistory.com/16

profile
Software Developer

0개의 댓글