putty에서 jar 파일 실행 시 thymeleaf template 오류

비전공자·2021년 7월 28일
1

AWS 사용기

목록 보기
3/4

동료의 aws 프젝 올리기를 도와주다가
sts에서 spring boot로 만든 프젝 jar 파일을 putty에서 실행했더니 아래와 같은 오류가 떴다



org.thymeleaf.TemplateEngine : [THYMELEAF][http-nio-8080-exec-7] Exception processing template "/login": Error resolving template [/login], template might not exist or might not be accessible by any of the configured Template Resolvers

org.thymeleaf.exceptions.TemplateInputException: Error resolving template [/login], template might not exist or might not be accessible by any of            the configured Template Resolvers


로그인 페이지를 찾을 수 없다는건데 구글링 해보니 절대경로를 상대경로로 바꿔주면 된대서 해봤더니 진짜 고쳐짐

"/login" -> "login"

그리고 빌드할 때 사용하지 않는 test 컨트롤러에서 오류나서 그것도 지워줌






또 다른 오류...
로그인 후 다음 페이지로 안넘어가서 봤더니 layout이 가려는 페이지를 못 찾음.

org.thymeleaf.TemplateEngine : [THYMELEAF][http-nio-8080-exec-1] Exception processing template "페이지 이름": Error resolving template [레이아웃 경로], template might not exist or might not be accessible by any of the configured Template Resolvers (template: "페이지 이름" - line 4, c ol 2)

해결 방법 : https://jamong-icetea.tistory.com/190

html 태그에 적힌 layout 경로 앞에 . 추가하니까 페이지 나옴
모든 페이지에 이렇게 추가해야 할 듯...






새로운 오류 : 폴더명을 고쳤는데 안 먹힘 -> 다시 새로고침 + 프로젝트 클린 + 메이븐 업데이트 (할 수 있는거 다함 ㅋㅋ)
후에 다시 빌드해서 배포하니 잘 나왔다.

profile
JUST DO IT!

0개의 댓글