com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class cn.edu.
时间:2019-03-19 12:08:22
收藏:0
阅读:2258
详细信息 https://www.cnblogs.com/xuwenjin/p/8832522.html
解决办法:
在实体类上面加上注解 @JsonIgnoreProperties(value = { "hibernateLazyInitializer", "handler" })
package cn.edu.aynu.Bean; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import java.io.Serializable; @JsonIgnoreProperties(value = { "hibernateLazyInitializer", "handler" }) public class Book implements Serializable { private String bookName; private String author; public Book(){ } public Book(String bookName, String author) { this.bookName = bookName; this.author = author; } }
原文:https://www.cnblogs.com/zhulina-917/p/10557487.html
评论(0)