最近在使用 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. linux audit审计(7-1)--读懂audit日志

     auid=0 auid记录Audit user ID,that is the loginuid.当我使用lbh用户登录系统时,再访问audit_test,此时记录的auid为1001,具体日志如下: ...

  2. ajax查看详细返回信息

    查看详细成功返回信息: success : function(data, textStatus, jqXHR) { console.log(data); console.log(textStatus) ...

  3. 面对AI

    面对AI,我们应该怎么做? 李开复博士的一段话: 1. 我们应该具有战略性思维,并以人工智能无法取代的工作为目标.我们应该致力于终身学习,更新我们的技能,了解新趋势,并寻找新机遇. 2. 我们应该鼓励 ...

  4. border-color的深入理解

    .className{ width:100px;height:100px; border:100px solid; border-color: red green blue orange; } 最终的 ...

  5. debug错误

    Description "opt_design" can fail with error messages similar to the following: opt_design ...

  6. spring和junit整合

  7. Nginx lingering_close延迟关闭

    L:130

  8. 扫描某目录下的所有文件的MD5码并导出文件【可执行jar】

    pom <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http:// ...

  9. 使用JSch远程执行shell命令

    package com.nihaorz.jsch; import com.jcraft.jsch.Channel; import com.jcraft.jsch.ChannelExec; import ...

  10. #189 stat(动态规划)

    容易想到固定第一个排列为1~n,算出答案后乘上n!即可,但这样就离正解走远了. 考虑排列dp的一般套路,将数从大到小加入排列,这样每个位置第一次填数时(不管是第一个还是第二个排列)其贡献就确定了. 显 ...