zoukankan      html  css  js  c++  java
  • Could not write JSON: No serializer found for class

    [ERROR][2021-07-21T16:39:41.557+0800][com.xiaojukeji.epower.atreus.common.configuration.GlobalExceptionHandler:116] _am_epower_atreus||traceid=07684ea1095649b0a4ef6ff2aa450ab4||spanid=88106210516f24dc||_msg=99999
    org.springframework.http.converter.HttpMessageNotWritableException: Could not write JSON: No serializer found for class com.xiaojukeji.epower.atreus.common.base.vo.smartcharging.order.OrderManagerVO and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS); nested exception is com.fasterxml.jackson.databind.JsonMappingException: No serializer found for class com.xiaojukeji.epower.atreus.common.base.vo.smartcharging.order.OrderManagerVO and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: com.xiaojukeji.epower.component.Response["data"]->com.baomidou.mybatisplus.extension.plugins.pagination.Page["records"]->java.util.ArrayList[0])

    Caused by: com.fasterxml.jackson.databind.JsonMappingException:
    No serializer found for class
    com.xiaojukeji.epower.atreus.common.base.vo.smartcharging.order.OrderManagerVO and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: com.xiaojukeji.epower.component.Response["data"]->com.baomidou.mybatisplus.extension.plugins.pagination.Page["records"]->java.util.ArrayList[0])

    问题原因:

    实体lombok注解@Accessors(chain = true)中fluent=true不要使用,不然在spring内部转json时会报以上错误
    另外最近使用easyexcel导出时也出现的诡异问题
    easyexcel实体使用Accessors注解会无法读取数据

    建议干脆别用这个注解了,问题太特么多了。心累。用Builder就可以了

    三分热血值得你十二分努力。
  • 相关阅读:
    用来武装Firebug的十三款Firefox插件
    五分钟搭建 Flash 视频直播站
    最新2010虎年元旦祝福短信
    Firefogg:轻松编码 OGG 视频
    winform编程DataGridView控件的使用总结
    flex实现的播放器
    flex学习笔记2
    jQuery 1.4 正式版发布
    开源路由器第三方固件openwrt衍生版xwrt
    Adobe Audition(Cool Edit)简易教程
  • 原文地址:https://www.cnblogs.com/woooodlin/p/no_serializer_found_for_class.html
Copyright © 2011-2022 走看看