Error creating bean with name 'postConstructInitializeBean': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Malformed escape pair at index
redis 서버와 연동을 테스트 하려던 중 발생한 오류이다.
lettuce 에서 뿜어낸 에러 같은데, RedisClient 를 create 할 때 입력해주는 비밀번호에 있는 특정 문자를 제대로 입력 받지 못하는 것 같다.
로 되어 있는 코드를
URLEncoder.encode() 를 이용하여 주었고, UTF-8 로 인코딩 하도록 했다.
이후 에러가 해결되었다.
필자의 경우에는 spring-boot-starter-web 패키지가 설치되어 있어 해당 메서드를 사용할 수 있었고, 해당 패키지를 사용하지 않는 프로젝트에서는 이 스택 오버 플로우에 있는 String(data, charset()) 이나 .toString(charset) 등을 활용하면 되지 않을까 싶다.
https://stackoverflow.com/questions/56691003/encode-string-to-utf-8-in-kotlin
반응형