인프런 커뮤니티 질문&답변
RestTemplate 사용시 에러
작성
·
347
0
http://127.0.0.1:8000/user-service/users/20c8cf35-8f44-4203-8072-b14619ca1068
호출시 계속 다음과 같이 에러가 발생하는데 도무지 원인을 모르겠습니다ㅠ.ㅠ
ERROR 63462 --- [o-auto-1-exec-2] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.http.converter.HttpMessageConversionException: Type definition error: [simple type, class lombok.Data]; nested exception is com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot deserialize Class lombok.Data (of type annotation) as a Bean
at [Source: (org.springframework.util.StreamUtils$NonClosingInputStream); line: 1, column: 1]] with root cause
com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot deserialize Class lombok.Data (of type annotation) as a Bean
at [Source: (org.springframework.util.StreamUtils$NonClosingInputStream); line: 1, column: 1]
답변 1
0
안녕하세요, 이도원입니다.
올려주신 에러 메시지만으로는 정확한 원인 파악이 어렵지만, user-service에서 사용자 ID를 이용하여 상세보기 하는 작업인 것 같습니다. user-service에서 order-service를 RestTemplate으로 호출하는 부분이 있는데, 여기에서 사용자의 주문목록을 ResponseOrder로 반환해 주는 부분이 있는데, user-service와 order-service 간에 일치하는 지를 확인해 보시기 바랍니다.
order-service측과 user-service 각각의 콘솔 로그를 확인해 추가로 공유해 주시면 원인 파악이 도움이 될 것 같습니다. 로그 메시지가 길 경우 아래 메일로 보내주셔도 됩니다.
edowon0623@gmail.com
감사합니다.





