Failed to read HTTP message: org.springframework.http.converter.HttpMessageNotReadableException: Required request body is missing: public xxxxxxxx.
最近在使用 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.的更多相关文章
- DefaultHandlerExceptionResolver : Failed to read HTTP message: org.springframework.http.converter.HttpMessageNotReadableException: Required request body is missing
客户端当发送空的json字符串时,请求RestController时,报错: DefaultHandlerExceptionResolver : Failed to read HTTP message ...
- org.springframework.http.converter.HttpMessageNotReadableException
发起请求报错:org.springframework.http.converter.HttpMessageNotReadableException 查看请求头: application/json 所以 ...
- Crash-fix-2:org.springframework.http.converter.HttpMessageNotReadableException
最近开始对APP上的Crash进行对应,发现有好多常见的问题,同一个问题在多个APP都类似的出现了,这里记录下这些常见的错误. crash Log: org.springframework.http. ...
- 异常:org.springframework.http.converter.HttpMessageNotReadableException
spring(springboot.springmvc)出现标题的异常一般是由于controller的入参失败引起的. 介绍下常规入参的两种格式: ,这种方式的入参主要是接受key-value的参数, ...
- spring boot 报错 Failed to read HTTP message
2008-12-13 15:06:03,930 WARN (DefaultHandlerExceptionResolver.java:384)- Failed to read HTTP message ...
- springmvc 格式化使用Jackjson格式化报Failed to write HTTP message
Failed to write HTTP message: org.springframework.http.converter.HttpMessageNotWritableException: Co ...
- Failed to write HTTP message,Could not write JSON错误
今天遇到使用@ResponseBody注解返回json数据时报错 Failed to write HTTP message: org.springframework.http.converter.Ht ...
- 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 ...
- 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 ...
随机推荐
- SQL Server2012中时间字段为DateTime和VarChar的区别
在设计数据库的时候varchar类型是一个非常常见的类型,很多字段都可以使用这个类型,所以有时候在设计数据库的时候就很容易习惯性设计该类型,比如说时间类型,我们既可以DateTime类型,又可以使用v ...
- JS检测是否是360浏览器
// JavaScript Document //application/vnd.chromium.remoting-viewer 可能为360特有 var is360 = _mime("t ...
- python数据结构与算法第十三天【归并排序】
1.代码实现 def merge_sort(alist): if len(alist) <= 1: return alist # 二分分解 num = len(alist)/2 left = m ...
- python RSA 加密与签名
PyCrypto装起来就简单多了,我是直接 sudo easy_install pycrypto 直接搞定的 先生成rsa的公私钥:打开控制台,输入 openssl 再输入 genrsa -out p ...
- How to vi
h:left,j:down,k:up,l:right.wq #write and quitx #cut one letterdd#cut one line/ #searchs/a/b/ #replac ...
- iOS WKWebView全屏浏览网页返回 状态栏问题
问题: 用这个方法隐藏显示状态栏,总是带有残余 过一会才能消失掉 [[UIApplication sharedApplication]setStatusBarHidden:YES]; 可以切换状态栏的 ...
- 鼠标事件-MouseEvent
当鼠标进行某种操作时,就会生成一个event对象,该对象记录着鼠标触发事件时的所有属性. 可以通过如下方法在google控制台打印出 MouseEvent 对象. function mouseDown ...
- Cash Machine POJ - 1276 多重背包二进制优化
题意:多重背包模型 n种物品 每个m个 问背包容量下最多拿多少 这里要用二进制优化不然会超时 #include<iostream> #include<cstdio> #in ...
- Heron and His Triangle HDU - 6222(pell 大数)
---恢复内容开始--- Heron and His Triangle Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 262144/2 ...
- 【BZOJ3816】【清华集训2014】矩阵变换 稳定婚姻问题
题目描述 给出一个\(n\)行\(m\)列的矩阵\(A\), 保证满足以下性质: 1.\(m>n\). 2.矩阵中每个数都是\([0,n]\)中的自然数. 3.每行中,\([1,n]\)中每个自 ...