当前位置:   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】
推荐阅读
相关标签
  

闽ICP备14008679号