thymeleaf와 Spring Security를 통해서 권한별로 볼 수 있게하는 메뉴를 설정을 하던 중, 갑작스럽게 아래와 같은 에러가 발생하였다.
There was an unexpected error (type=Internal Server Error, status=500).
org.thymelaf.context.IWebContext.getExchange()Lorg/thymeleaf/web/IWebExchange;
java.lang.NoSuchMethodError: org.thymeleaf.context.IWebContext.getExchange()Lorg/thymeleaf/web/IWebExchange;
구글링 결과 나오는 답이 최신버전의 thymeleaf-spring-security5를 사용할 때, 발생하는 일이라고 떠서, dependcy의 버전을 낮췄다.
<변경 전>
implementation 'org.thymeleaf.extras:thymeleaf-extras-springsecurity5:3.1.1.RELEASE'
<변경 후>
implementation 'org.thymeleaf.extras:thymeleaf-extras-springsecurity5:3.0.4.RELEASE'
이후에는 NoSuchMethodError가 발생하지 않았다.