【error处理】org.springframework.http.converter.HttpMessageConversionException: Type definition error

控制台的error日志:

org.springframework.http.converter.HttpMessageConversionException: Type definition error: [simple type, class com...entity..[某一具体实体类]]; nested exception is com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class com...entity..[某一具体实体类] and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS)

划重点:

  • org.springframework.http.converter.HttpMessageConversionException
  • Type definition error 定义错误
  • No serializer found 序列化器无法找到
  • no properties discovered 属性没法找到(没有getter、setter)

原因

忘记在实体类上加 @Data 注解

解决

对应的实体类上加上 @Data 注解

相关文章:

  • 2021-12-01
  • 2022-01-14
  • 2022-01-18
  • 2022-01-07
  • 2022-12-23
  • 2021-06-02
  • 2021-11-20
  • 2021-08-13
猜你喜欢
  • 2022-12-23
  • 2021-08-14
  • 2022-03-04
  • 2022-12-23
  • 2021-08-11
  • 2021-06-07
相关资源
相似解决方案