zoukankan      html  css  js  c++  java
  • shop = mapper.readValue(shopStr, Shop.class); shop=null的问题

    shop = mapper.readValue(shopStr, Shop.class); shop=null的问题

    Unrecognized field "shopCategory" (class com.hbue.o2o.entity.Shop), not marked as ignorable (14 known properties: "shopName", "priority", "shopDesc", "createTime", "shopImg", "phone", "shopId", "owner", "enableStatus", "advice", "shopCategroy", "shopAddr", "lastEditTime", "area"])
    at [Source: {"shopName":"测试","shopAddr":"爱爱","phone":"13366666777","shopDesc":"aaaaaaaaa","shopCategory":{"shopCategoryId":3},"area":{"areaId":3}}; line: 1, column: 95] (through reference chain: com.hbue.o2o.entity.Shop["shopCategory"])

     通过e.printStackTrace()打印异常信息发现Unrecognized field "shopCategory"错,然后进入shop实体类中发现shopCategory的set get方法出错 导致数据不匹配 无法进行json 数据转换

  • 相关阅读:
    计蒜客 动态规划基础 蒜头跳木桩
    委托的使用和合并
    asp.net "callback" 和 "postback" 的区别.
    3 顶层父类
    2 异常类
    1 智能指针
    16 #error 和 #line
    15 条件编译
    14 宏
    13 编译和链接
  • 原文地址:https://www.cnblogs.com/YoungSone/p/12399374.html
Copyright © 2011-2022 走看看