no properties discovered to create BeanSerializer 问题解决
·
SpringBoot整合DBHelper的时候出现如下的报错:
no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: com.github.pagehelper.PageInfo["list"]->com.github.pagehelper.Page[0])
当时看到是序列化报错,马上检查了自己所有的bean,都implements Serializable了
然后去查了一下SpringBoot对Json格式的解析,果真Springboot中有一套对Json格式输出的严格控制--JackSon
问题解决的办法其实就是差了一句properties配置:<将jackSon关闭即可>
spring.jackson.serialization.FAIL_ON_EMPTY_BEANS=false
AtomGit 是由开放原子开源基金会联合 CSDN 等生态伙伴共同推出的新一代开源与人工智能协作平台。平台坚持“开放、中立、公益”的理念,把代码托管、模型共享、数据集托管、智能体开发体验和算力服务整合在一起,为开发者提供从开发、训练到部署的一站式体验。
更多推荐


所有评论(0)