在使用Dozer將List轉爲List時,出現錯誤Resolved [org.springframework.http.converter.HttpMessageConversionE

Resolved [org.springframework.http.converter.HttpMessageConversionException: Type definition error: [simple type, class com.lz.game.system.entity.vo.TagVo]; nested exception is com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class com.lz.game.system.entity.vo.TagVo and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: com.lz.game.common.api.R[“data”]->java.util.HashMap[“records”]->java.util.ArrayList[0])]

網上查找發現原來是缺少getter和setter方法,加了個@Data註解就行了。記在這,以防下次遇到。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章