码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2019-03-19 12:14:42      阅读:2034      评论:0      收藏:0      [点我收藏+]

标签:package   targe   htm   www   import   解决办法   not   get   实体类   

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

标签:package   targe   htm   www   import   解决办法   not   get   实体类   

原文地址:https://www.cnblogs.com/zhulina-917/p/10557487.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!