티스토리 뷰

반응형

웹화면에서는 VM136:1 Uncaught SyntaxError: Unexpected end of JSON input이라고 뜨고...

서버에서는 ERROR org.apache.catalina.core.ContainerBase.[Tomcat].[localhost].[/].[dispatcherServlet] - Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.http.converter.HttpMessageNotWritableException: Could not write JSON: Infinite recursion (StackOverflowError); nested exception is com.fasterxml.jackson.databind.JsonMappingException: Infinite recursion (StackOverflowError) (through reference chain: .......라고 뜨는데

무엇이 문제일까?라고 고민해보았는데 @RestController으로 데이터를 주고 받는데 json의 데이터가 너무 길어서 생기는 문제였다. 예를 들어서 사용자 정보 테이블에서 등록자가 Entity로 될 경우 같은...

해결 방법은 문제가 되는 dto 데이터를 쉽게 풀어라.. 예를들어서 dto userEntity가 있다면 username, userid로 나누어서 받도록 하면 문제가 해결 된다.

댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
글 보관함