본문 바로가기
Develop/Trouble Shooting

Spring) 빌드 시, Error starting ApplicationContext 에러 해결

by jaeyoungb 2022. 10. 23.

에러 화면

 

Spring project를 빌드했을 때, 위와 같은 에러가 발생했다.

 

'Error starting ApplicationContext 에러' 라고 구글링을 해본 결과, 다음과 같은 해결법이 있었다.

 

Edit Configurations...  →  Modify options  →  Enable debug output 체크

 

 

 

그러나, 위 방법으로는 해결되지 않았고, 콘솔창에 나와 있는 에러 메세지를 자세히 확인해본 결과,

 

8080 포트가 이미 사용 중이라고 되어 있었다.

 

이미 사용 중인 8080 포트를 끄는 방법은 다음과 같다.

 

cmd 열기  →  netstat -ano 입력  →  8080 포트의 PID 번호 확인  →  taskkill /f /pid PID번호

윈도우 탐색기에 cmd 입력 후 엔터
taskkill /f /pid '8080 포트의 pid 번호'

 

이렇게 8080 포트를 강제로 종료시키고 나서, 다시 어플리케이션을 재실행하면 정상 작동될 것이다.

 

 

Ref)

https://velog.io/@dydaks7878/Error-starting-ApplicationContext.-To-display-the-conditions-report-re-run-your-application-with-debug-enabled

https://m.blog.naver.com/adamdoha/221754911797