개발(Web)/Web

[Tomcat] The server cannot be started because one or more of the ports are invalid. Open the server editor and correct the invalid ports.

shinyelee 2020. 7. 14. 23:38

The server cannot be started because one or more of the ports are invalid. Open the server editor and correct the invalid ports.

이클립스 설치는 이 영상을 참고하면 됨

"하나 또는 그 이상의 포트를 인식할 수 없어 서버를 시작할 수 없습니다. 서버 편집기를 열고 문제의 포트를 정정하시오."


방법 1. Tomcat admin port를 8005로 변경

Tomcat admin port 미설정이 원인. 화면 아래쪽 Servers → Tomcat v8.5 Server at localhost [Stopped, Synchronized] 더블클릭
Tomcat v8.5 Sever at localhost → Tomcat admin port의 Port Number 확인
Port Number를 8005로 바꿔주기 → Ctl+S
이클립스 재시작
HelloWorld.html 탭으로 돌아옴 → Run(실행) 버튼 클릭
된다ㅠㅠㅠㅠㅠㅠㅠㅠ


콘솔창에 404 Not Found 관련 경고 메시지 제거

하는 김에 Server Options의 Publish module contexts to separate XML files에도 체크
변경사항 저장 후 html파일을 다시 실행하려고 했으나...왜죠
The server cannot be saved for the following reasons: [Overview] The server must be stopped before a change to the "Publish module contexts to separate XML files" setting can be saved. → 대충 설정을 변경하기 전 서버를 반드시 정지해야 변경사항이 저장된다는 내용


방법 1. 톰캣 껐켰

작업 관리자 → Apache Commons Daemon Service Manager → 파일 위치 열기
이미 꺼져있긴 한데 그럼 켰다 꺼보자. Tomcat8w → Start → Stop → 확인
다시 체크 후 저장
이클립스 종료
일단 성공. 다시 html 파일을 실행해 제대로 돌아가는지 알아보자
Several ports (8005, 8088) required by Tomcat v8.5 Server at localhost are already in use. The server may already be running in another process, or a system process may be using the port. To start this server you will need to stop the other process or change the port number(s).


방법 2. 서버 포트 번호 변경

포트 8005, 8088이 이미 사용중이라 실행 불가. 지금 PC에 설치한 이클립스가 3개째(학원 과목/강사님마다 버전/설정도 다르고, 워크스페이스도 분리할 겸)인데 이전에 JSP 복습 용도로 이클립스를 설치할 때 해당 포트 번호를 이미 사용한 게 문제인 것 같다.

Details를 클릭, 오류 메시지를 복붙해 다시 구글링

구글링해보니 해결 방법은 크게 2가지다.

방법 1. 8080 포트를 사용하는 프로세스를 강제 종료.

방법 2. 이클립스에서 사용할 서버 포트 번호를 변경.

1번 방법을 쓰면 JSP용 이클립스 실행에 문제가 생길 것 같아 2번 방법을 시도하기로 했다.

Tomcat admin port number : 8005 →8050으로, HTTP port number : 8080 → 8000으로
저장 후 재실행. 이번에도 안 되면 잠 못 잔다
이제 발 뻗고 잘 수 있음

반응형