1. 问题

org.springframework.http.converter.HttpMessageNotWritableException: Could not write content: No serializer found for class com.xianzhi.jinba.vo.NewNewsFlash$Explain and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) ) (through reference chain: java.util.HashMap["body"]->java.util.ArrayList[1]->java.util.HashMap["explain"]->java.util.ArrayList[0]); nested exception is com.fasterxml.jackson.databind.JsonMappingException: No serializer found for class com.xianzhi.jinba.vo.NewNewsFlash$Explain and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) ) (through reference chain: java.util.HashMap["body"]->java.util.ArrayList[1]->java.util.HashMap["explain"]->java.util.ArrayList[0])
 

 


Could not write content: No serializer found for class and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) )

2. 解决方案

原因,bean中属性为private,改为public

相关文章:

  • 2021-06-22
  • 2022-12-23
  • 2022-02-22
  • 2022-12-23
  • 2022-12-23
  • 2021-06-29
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-11-23
  • 2021-05-30
  • 2022-12-23
  • 2021-10-13
  • 2022-12-23
  • 2021-05-26
相关资源
相似解决方案