본문 바로가기
Spring

TemplateInputException: Error resolving template, template might not exist or might not be accessible by any of the configured Template Resolvers] 예외 해결

by 코더 제이콥 2023. 8. 2.

1. 문제상황

분명 로컬에서는 아무런 문제가 없었는데, EC2에 jar를 배포하자 사이트는 먹통이 되었습니다.

위와 같은 예외가 터졌습니다. 

@GetMapping("/find-id")
public String findId(){
    return "/login/find-id";
}

컨트롤러에서 뷰 탬플릿 이름을 리턴할 때 슬래쉬('/')를 포함해서 리턴했기 때문에 발생한 예외였습니다. IDE에서 돌릴 때는 상관 없지만, jar로 배포할 때는 문제가 된다고 합니다.