org.springframework.http.converter.HttpMessageConversionException: T
Posted figsprite
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了org.springframework.http.converter.HttpMessageConversionException: T相关的知识,希望对你有一定的参考价值。
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"])
at org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter.writeInternal(AbstractJackson2HttpMessageConverter.java:293)
at org.springframework.http.converter.AbstractGenericHttpMessageConverter.write(AbstractGenericHttpMessageConverter.java:103)
at org.springframework.web.servlet.mvc.method.annotation.AbstractMessageConverterMethodProcessor.writeWithMessageConverters(AbstractMessageConverterMethodProcessor.java:290)
at org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor.handleReturnValue(RequestResponseBodyMethodProcessor.java:180)
at org.springframework.web.method.support.HandlerMethodReturnValueHandlerComposite.handleReturnValue(HandlerMethodReturnValueHandlerComposite.java:82)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:119)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:892)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:797)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1038)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:942)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1005)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:908)
仔细瞅瞅原来是ItemVO忘记加get/set方法了
以上是关于org.springframework.http.converter.HttpMessageConversionException: T的主要内容,如果未能解决你的问题,请参考以下文章
无法序列化“org.springframework.http.ResponseEntity”HazelcastCache
org.springframework.http.converter.HttpMessageConversionException: T
org.springframework.http.MediaType 中的标记字符“/”无效
Not found org.springframework.http.converter.json.MappingJacksonHttpMessageConverter
Spring 一对多关系抛出异常:org.springframework.http.converter.HttpMessageNotWritableException
org.springframework.http.converter.HttpMessageNotWritableException 没有找到类型的返回值的转换器:类