当前位置: 代码迷 >> 综合 >> jackson.databind.exc.InvalidDefinitionException:NoSerializerFoundForClassCom.project.domain.Account
  详细解决方案

jackson.databind.exc.InvalidDefinitionException:NoSerializerFoundForClassCom.project.domain.Account

热度:77   发布时间:2024-01-31 12:36:50.0

报错信息

Type definition error: [simple type, class com.project.domain.Account];
nested exception is com.fasterxml.jackson.databind.exc.InvalidDefinitionException: 
No serializer found for class com.project.domain.Account 
and no properties discovered to create BeanSerializer 
(to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) 
(through reference chain: com.project.domain.GeneralResult[\"data\"])

解决办法:将基本数据类型更换成对应的包装类

  相关解决方案