com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class cn.edu.

Posted zhulina-917

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class cn.edu.相关的知识,希望对你有一定的参考价值。

详细信息   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;
    }
}

 

以上是关于com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class cn.edu.的主要内容,如果未能解决你的问题,请参考以下文章