반응형

심각: Servlet.service() for servlet [appServlet] in context with path [] threw exception [java.lang.IllegalStateException: getOutputStream() has already been called for this response] with root cause

java.lang.IllegalStateException: getOutputStream() has already been called for this response


spring + jpa 환경에서


@ResponseBody 하면서 json 으로 응답하면서 jpa 관계 설정이 안맞아서 인지 예외가 발생했다.

Entity 에 @JsonBackReference 를 적당히 사용하면 된다고 나왔다.


@OneToMany 관계에서 일대다 관계에서 @JsonBackReference 써주면 OneToMany관계의 다의 관계 데이터가 Json 으로 잘 변환되어

넘어온다.


흐흐.. 어렵다.

반응형

+ Recent posts