반응형

Exception processing template "/main": Error resolving template [/main], template might not exist or might not be accessible by any of the configured Template Resolvers

이란 오류가 발생했다. 
분명 로컬에선 잘 돌아갔는데 호스팅했을땐 안돼서 몇시간을 삽질했는데,

다음의 구글링을 통해 그 원인을 알게됐다.
https://myserena.tistory.com/155

 

template might not exist or might not be accessible by any of the configured Template Resolvers

문제발생상황 회원가입 버튼을 누르면 500에러가 발생. 로그를 확인해보니 Error resolving template “/fragments/footer”, template might not exist or might not be accessible by any of the configured Tem..

myserena.tistory.com

에 따르면 view에 대한 path를 다음과 같이 /main으로 했었기 때문에 //main 으로 되어 path해석이 불가능했던것이다.
그러면 왜 내 local, Intellj에선 실행이 됐지?(헷갈리게 말이다..)

When you’re running in your IDE the resource is available straight off the filesystem and the double slash doesn’t cause a problem. When you’re running from a jar file the resource is nested within that jar and the double slash prevents it from being found.

-> //에대한 처리는 IDE에서는 처리를 해 주고, jar 배포시에는 처리를 못한다.

그래서 return "main" 으로 수정해줬더니 해당 path로 잘 return된것을 확인할 수 있었다.

 

 

+ Recent posts