1.실행했을 때 ERR_CONNECTION_REFUSED
URL은 맞는데 요청이 서버 자체에 닿지 않는 문제가 있었고, 화면에는 다음 메시지가 출력됐다.

이 오류는 URL이나 매핑 문제가 아니라 Tomcat 서버가 정상적으로 실행되지 않은 상태에서 발생하는 경우였다.
원인은 두 가지였다:
- 프로젝트가 Tomcat에 배포되지 않은 상태
- 서버 실행 포트(8080 vs 8088) 불일치
확인 과정에서 wtpwebapps 경로에 프로젝트 폴더가 생성되지 않은 걸 보고 배포가 되지 않았음을 확인했다.
해결 과정은 다음 순서대로 수행했다.
- Servers → Add and Remove... 에서 프로젝트 추가
- Tomcat Clean
- Project Clean
- 서버 재시작
이 과정 후 브라우저에서 프로젝트 URL 응답이 정상적으로 들어오게 되었다.
2. web.xml 서블릿 경로 오타
서버 실행 직후 HTTP 500 내부 서버 오류가 발생했다.
오류 메시지는 다음과 같았다.
원인을 찾는 과정에서 web.xml 내부에 오타가 있었다.
❌ conteroller.common.FrontController
⭕ controller.common.FrontController
수정보다 삭제하고 새로 만드는게 빠를것 같아서 경로 꼬임 방지를 위해 프론트 컨트롤러 서블릿과 서블릿 매핑을 먼저 삭제하고 새로 만들었다
<servlet>
<servlet-name>FrontController</servlet-name>
<display-name>FrontController</display-name>
<description></description>
<servlet-class>controller.common.FrontController</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>FrontController</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
3. FrontController 내부 command 추출 오류
FrontController가 요청 URL을 제대로 인식하지 못해 ActionFactory에서 null을 반환하는 문제가 발생했다.
로그 출력
[ERROR] ActionFactory에서 action을 찾지 못함
원인은 request.getRequestURI() 를 그대로 command 로 사용했기 때문이다.
예)
요청: /kakaoLogin/kakaoLogin.do
map 키: /kakaoLogin.do → 불일치
해결:
String uri = request.getRequestURI();
String ctx = request.getContextPath();
String command = uri.substring(ctx.length());
이 코드 적용 후 요청이 정상적으로 ActionFactory에 매핑되었다.
4.NullPointerException (ActionForward null)
KakaoLoginAction 실행은 되었지만 return 값이 null이라
FrontController에서 forward 처리 시 에러가 발생했다.
forward.isRedirect() ← NullPointerException
원인: KakaoLoginAction 내부 return 값이 다음과 같았다.
ActionForward forward = null;
return forward;
해결 방법:
ActionForward forward = new ActionForward();
forward.setPath("main.do");
forward.setRedirect(true);
return forward;
이후 redirect가 정상 작동했다.
'🐢🐢꼬부기 LV.2 | 실습•에러 > 🛡️껍질에 숨기(에러해결)' 카테고리의 다른 글
| 커스텀 태그 사용 오류 해결 (0) | 2025.12.01 |
|---|---|
| 카카오 로그인 API 자바로직 오류 해결 2 (0) | 2025.11.30 |
| 카카오 로그인 API 연동 오류 정리 (0) | 2025.11.28 |
| FrontController/ActionFactory 에러해결하기 (0) | 2025.11.27 |
| 서블릿경로 ClassNotFoundExection 해결 (0) | 2025.11.27 |