最近在使用 springBoot开发的时候, 使用PostMan访问接口,  返回一个 404 ,  后台报一个 warn :

      Failed to read HTTP message: org.springframework.http.converter.HttpMessageNotReadableException: Required request body is missing:

          public com.syh.foundation.ResponseMessage com.xxxxx.list(xxxxx.vo.AppCostVo)

检查了各个类, 排查了各个可能的地方都没有发现错误, 左后在网上 查找到有人  报   : Failed to write HTTP message  错误, 其解释为:

{      

    这个异常是我在使用Spring中,在JavaBean中使用了包装类Integer,

    private Integer  pageNum;而在方法中使用了@ResponseBody注解,

    在return  map返回给前台时Spring中的类com.fasterxml.jackson.databind.JsonMappingException

    这个类会对包装类自动拆箱成对应的基本类型,如果返回的Integer中存在null的话,那么在拆箱成int时就会报错

    如果将null赋值给包装类Integer,然后将Integer赋给各自的基本类型,编译器不会报,但是你将会在运行时期遇到空指针异常。

    这是Java中的自动拆箱导致的,任何含有null值的包装类在Java拆箱生成基本数据类型时候都会抛出一个空指针异常。

}      其博客连接 :https://blog.csdn.net/wgs_93/article/details/56014607

write是这样的原因,  那么  read  就是 传入了空值诺  ???

我这里使用了 vo类接收参数, 并且使用 了   @requsetBody 注解,  所以与上文原因类似~~~

一检查果然是这样的。。。。。

Failed to read HTTP message: org.springframework.http.converter.HttpMessageNotReadableException: Required request body is missing: public xxxxxxxx.的更多相关文章

  1. DefaultHandlerExceptionResolver : Failed to read HTTP message: org.springframework.http.converter.HttpMessageNotReadableException: Required request body is missing

    客户端当发送空的json字符串时,请求RestController时,报错: DefaultHandlerExceptionResolver : Failed to read HTTP message ...

  2. org.springframework.http.converter.HttpMessageNotReadableException

    发起请求报错:org.springframework.http.converter.HttpMessageNotReadableException 查看请求头: application/json 所以 ...

  3. Crash-fix-2:org.springframework.http.converter.HttpMessageNotReadableException

    最近开始对APP上的Crash进行对应,发现有好多常见的问题,同一个问题在多个APP都类似的出现了,这里记录下这些常见的错误. crash Log: org.springframework.http. ...

  4. 异常:org.springframework.http.converter.HttpMessageNotReadableException

    spring(springboot.springmvc)出现标题的异常一般是由于controller的入参失败引起的. 介绍下常规入参的两种格式: ,这种方式的入参主要是接受key-value的参数, ...

  5. spring boot 报错 Failed to read HTTP message

    2008-12-13 15:06:03,930 WARN (DefaultHandlerExceptionResolver.java:384)- Failed to read HTTP message ...

  6. springmvc 格式化使用Jackjson格式化报Failed to write HTTP message

    Failed to write HTTP message: org.springframework.http.converter.HttpMessageNotWritableException: Co ...

  7. Failed to write HTTP message,Could not write JSON错误

    今天遇到使用@ResponseBody注解返回json数据时报错 Failed to write HTTP message: org.springframework.http.converter.Ht ...

  8. org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'multipartResolver': Failed to introspect bean class [org.springframework.web.multipart.commons.CommonsMultipartR

    在用spring mvc 做文件上传的时候出现了这个问题(能看到这篇文章就说明你已经有了那两个包了) 错误:org.springframework.beans.factory.BeanCreation ...

  9. AutoCAD LoadLibrary Failed with error 126 Message

    LoadLibrary Failed with error 126 Message BY C3DISH ON 26 MAY, 2013 · ADD COMMENT I wanted to post a ...

随机推荐

  1. qtp 自动化测试---点滴 获取属性性/修改窗体标题

    1 GetROProperty获取对应属性值 value url (这里出错了) If Window("新增").WinObject("TRzDBEdit_10" ...

  2. yolo算法解析

  3. spring和junit整合

  4. 搭建Hexo博客(三)—换电脑继续写Hexo博客

    Hexo和GitHub搭建博客的原理是:Hexo将source下的md文件生成静态的html页面,存放到public目录中,这一步是由命令:hexo -g完成.接下来执行hexo -d命令,就将pub ...

  5. 在一台服务器上配置多个Tomcat的方法

    原文来自:http://blog.csdn.net/lmb55/article/details/49561669 这段时间在开发智能导航的热部署功能,需要从一台服务器去访问其它的24台服务器去进行相关 ...

  6. Flask 构建微电影视频网站(二)

    搭建前台页面 前台布局搭建 将static中的文件拷贝到项目的static目录下 在app/templates/home下新建home.html,当作基础模板,并修改静态资源链接 <!docty ...

  7. bzoj 1854: [Scoi2010]游戏 (并查集||二分图最大匹配)

    链接: https://www.lydsy.com/JudgeOnline/problem.php?id=1854 写法1: 二分图最大匹配 思路:  将武器的属性对武器编号建边,因为只有10000种 ...

  8. Codeforces Round #541 (Div. 2) D(并查集+拓扑排序) F (并查集)

    D. Gourmet choice 链接:http://codeforces.com/contest/1131/problem/D 思路: =  的情况我们用并查集把他们扔到一个集合,然后根据 > ...

  9. github 快速部署

    在github上 新建一个项目后,并且未提交任何代码,会有一个页面提示我们如何快速部署.在此备份一下那个页面 Quick setup — if you’ve done this kind of thi ...

  10. zabbix python 微信告警脚本

    测试zabbix的微信告警耗费了大量时间,使用了开源工具(OneOaaS weixin-alert).shell脚本工具(手动执行正常,服务器调用失败),均没有实现相关功能以下是自己优化过的Pytho ...