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方法了

原文地址:https://www.cnblogs.com/figsprite/p/10981323.html

时间: 2024-10-10 07:07:04

org.springframework.http.converter.HttpMessageConversionException: T的相关文章

org.springframework.http.converter.json.MappingJacksonHttpMessageConverter

1.错误描述 严重: Servlet /huxs threw load() exception java.lang.ClassNotFoundException: org.springframework.http.converter.json.MappingJacksonHttpMessageConverter at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1645) at org

Not found org.springframework.http.converter.json.MappingJacksonHttpMessageConverter

在配置Spring RESTFul应用时,发现包类org.springframework.http.converter.json.MappingJacksonHttpMessageConverter找不到的错误,下面提供了包的下载地址. http://repo1.maven.org/maven2/com/fasterxml/jackson/core/ 不过,版本有变化,应将配置文件中的 MappingJacksonHttpMessageConverter 修改为: MappingJackson2

Spring 4.x org.springframework.http.converter.json.MappingJacksonHttpMessageConverter ClassNotFoundException:

Spring 4.x The first major version of Jackson is no longer supported in Spring 4. The class you want to use is now org.springframework.http.converter.json.MappingJackson2HttpMessageConverter. Make sure that you have com.fasterxml.jackson.core/jackson

Springmvc 中org.springframework.http.converter.json.MappingJackson2HttpMessageConverter依赖jackson包

1,问题详情:Spring使用4.3.5.Release版本后 在SpringMvc配置文件中配置json 解析器后出现报错信息 [org.springframework.web.context.ContextLoader]Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.

SpringMVC分页查询无法直接将对象转换成json的解决办法(报org.springframework.http.converter.HttpMessageNotWritableException: No converter found for return value of type:错)

在用ajax获得分页数据时,无法将获取的值赋值给input标签,在修改用户信息时不显示用户已经注册的信息,百度可知 springmvc处理分页数据返回的对象时,无法直接将对象转换成json,会报org.springframework.http.converter.HttpMessageNotWritableException: No converter found for return value of type:错误, 需要在springmvc返回前先转换为json 步骤如下: 1.添加依赖(

org.springframework.http.converter.HttpMessageNotReadableException

发起请求报错:org.springframework.http.converter.HttpMessageNotReadableException 查看请求头: application/json 所以post请求 data : 需要 data = json.dumps(data)resp = request.post(url, data) 原文地址:https://www.cnblogs.com/zwp-627/p/12061492.html

spring boot 全局异常处理

import cn.sisyphe.framework.web.exception.DataException; import lombok.extern.slf4j.Slf4j; import org.springframework.http.HttpStatus; import org.springframework.http.converter.HttpMessageConversionException; import org.springframework.validation.Bin

Java对象和XML的相互转换化

https://blog.csdn.net/u010331823/article/details/78258311 写在前面:Jaxb是JavaEE的规范.全称Java Architecture for XML Binding.  可以根据XML Schema产生Java类的技术.JAXB也提供了将XML实例文档反向生成Java对象树的方法,并能将Java对象树的内容重新写到XML实例文档.  JAXB 2.0是JDK 1.6的组成部分.JAXB 2.2.3是JDK 1.7的组成部分,在实际使用

170616、解决 java.lang.IllegalArgumentException: No converter found for return value of type: class java.util.ArrayList

报错截图: 原因:搭建项目的时候,springmvc默认是没有对象转换成json的转换器的,需要手动添加jackson依赖. 解决步骤: 1.添加jackson依赖到pom.xml <!-- jaskson --> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-core</artifactId> <version>