0
点赞
收藏
分享

微信扫一扫

使用pageHelper报错 Type definition error: [simple type, classXXXX]


使用pageHelper的时候报错:

Type definition error: [simple type, class XXXXX]; nested exception is com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class XXXXX and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: com.tfjy.XXXX.utils.FrontResult[“data”]->com.github.pagehelper.PageInfo[“list”]->com.github.pagehelper.Page[0])

使用pageHelper报错 Type definition error: [simple type, classXXXX]_Data


解决办法,在返回值类型实体上加@Data注解

使用pageHelper报错 Type definition error: [simple type, classXXXX]_github_02


使用pageHelper报错 Type definition error: [simple type, classXXXX]_值类型_03

然后就能正常显示返回值了。

@Data注解的主要作用是提高代码的简洁,使用这个注解可以省去实体类中大量的get()、 set()、 toString()等方法。但是目前不知道和序列化serializer有什么关系。


举报

相关推荐

0 条评论