zoukankan      html  css  js  c++  java
  • 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) )

    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])
     
    
    

    2. 解决方案

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

  • 相关阅读:
    链表
    Python中安装Requests库
    在vs中使用python
    CentOS添加windows引导
    c#创建windows服务
    SQLServer查询结果另存为csv格式中文乱码问题
    用svn管理GitHub项目
    Jquery操作select
    sqlserver2016安装
    信号处理函数陷阱:调用malloc导致死锁[转]
  • 原文地址:https://www.cnblogs.com/an5211/p/8549401.html
Copyright © 2011-2022 走看看