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 数据转换

  • 相关阅读:
    少走弯路的10条忠告
    思考
    哈弗经典校训
    项目导出excel引发的一些问题
    hibernate 缓存设置
    dubbo简单用法
    sql 类型问题
    spring this.logger.isDebugEnabled()
    红黑树
    归并排序
  • 原文地址:https://www.cnblogs.com/YoungSone/p/12399374.html
Copyright © 2011-2022 走看看