当前位置:   article > 正文

com.fasterxml.jackson.databind.JsonMappingException: (was java.lang.NullPointExcepti 单属性VO在序列化时空指针异常

com.fasterxml.jackson.databind.jsonmappingexception: (was java.lang.nullpoin
  1. @ValueObject
  2. @Embeddable
  3. @Getter
  4. @NoArgsConstructor()
  5. @AllArgsConstructor(staticName = "of")
  6. public class ContentInvestmentNo implements Serializable {
  7. private String uerName;
  8. }
  1. @ValueObject
  2. @Embeddable
  3. @Getter
  4. @NoArgsConstructor()
  5. @AllArgsConstructor(staticName = "of")
  6. @JsonSerialize(using = ToStringSerializer.class)
  7. public class ContentInvestmentNo implements Serializable {
  8. private String userName;
  9. }

在VO上增加注解 :

@JsonSerialize(using = ToStringSerializer.class)

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/代码探险家/article/detail/743109
推荐阅读
相关标签
  

闽ICP备14008679号