JSONObject result = new JSONObject();
Person person = new Person();
person.setId(1);
person.setName("张三");
List<Person> personList = new ArrayList<Person>();
personList.add(person);
person.setPersonList(personList);
result.put("person", person);
Handling of [org.springframework.http.converter.HttpMessageNotWritableException] resulted in Exception
java.lang.IllegalStateException: Cannot call sendError() after the response has been committed
...(以下省略)
在2.2.1版本下的错误信息为:
org.springframework.http.converter.HttpMessageNotWritableException: Could not write content: Infinite recursion (StackOverflowError) (through reference chain: java.util.ArrayList[0]->com.unuse.diary.api.Person["personList"]->java.util.ArrayList[0]->com.unuse.diary.api.Person["personList"] ...(以下省略)