请教一下,为啥return CommonReturnType.create(itemVO)就会报下面这个错误?
WARN 2332 --- [nio-8090-exec-1] .m.m.a.ExceptionHandlerExceptionResolver :
Resolved [org.springframework.http.converter.HttpMessageConversionException: Type definition error: [simple type, class com.miaoshaproject.controller.viewobject.ItemVO]; nested exception is com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class com.miaoshaproject.controller.viewobject.ItemVO and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: com.miaoshaproject.response.CommonReturnType["data"])]
我调试了一下,发现
BeanUtils.copyProperties(itemModel, itemVO);
根本就没有把属性值copy给itemVO,但是我的itemModel和itemVO的字段完全一致,包括字段的类型。这是为什么