Spring Boot Jackson No serializer found for class
Jackson Spring Boot About 414 wordsSpring Boot Jackson No serializer found for class
错误信息
No serializer found for class xxx and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: java.util.ArrayList[0])
错误原因
序列化的对象,没有setter
、getter
方法。
解决方法
添加Lombok
相关的注解:@Data
或者@Setter
、@Getter
。
或者:生成setter
、getter
方法。
@Setter
@Getter
@ToString
public class MyObject {
}
Views: 92 · Posted: 2025-09-29
————        END        ————
Give me a Star, Thanks:)
https://github.com/fendoudebb/LiteNote扫描下方二维码关注公众号和小程序↓↓↓

Loading...