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 ...
随机推荐
- iperf网络测试
iperf网络测试文档 地址: https://www.jianshu.com/p/942a9d9bc704
- 使用Guava cache构建本地缓存
前言 最近在一个项目中需要用到本地缓存,在网上调研后,发现谷歌的Guva提供的cache模块非常的不错.简单易上手的api:灵活强大的功能,再加上谷歌这块金字招牌,让我毫不犹豫的选择了它.仅以此博客记 ...
- H5的使用
1.h5的部分标签浏览器兼容性问题 解决方案: <head> <!--[if lt IE 9]> <script src="http://cdn.static ...
- LoadRunner Vuser接口测试脚本 Post举例
发送内容为JSON的POST请求需要加入"EncType=application/json",表单参数不需要.(JAVA API) // POST接口调用 web.custom_r ...
- PCIE\AURORA\SRIO协议对比
http://www.eefocus.com/communication/335836/p3
- 基于MMSE的预测
本文的目的是预测随机变量的输出值. 既然有预测值,那么我们就需要一个判断基准(criterion)用于判断该预测值与该随机变量的实际输出之间的差值,这里采用的判断基准就是MSE(mean-square ...
- Ubuntu基于zsh自定义设置shell主题
为优化Ubuntu命令行页面效果,Google一番选择github上开源项目zsh,以自定义Shell主题,注:本机系统为Ubuntu 14.04 1.安装zsh sudo apt-get insta ...
- 洛谷P1414又是毕业季二题解
题目 思想: 首先这个题必定是一个数学题,肯定不是一个一个枚举得到解,这样肯定会T,所以我们就应该想一些别的方法,. 分析: 比如,答案,一定是递减的,因为该答案所满足的条件肯定是越来越苛刻的,所以我 ...
- ☆ [HDU2089] 不要62「数位DP」
类型:数位DP 传送门:>Here< 题意:问区间$[n,m]$的数字中,不含4以及62的数字总数 解题思路 数位DP入门题 先考虑一般的暴力做法,整个区间扫一遍,判断每个数是否合法并累计 ...
- ALGO-19 审美课
算法训练 审美课 时间限制:1.0s 内存限制:256.0MB 问题描述 <审美的历程>课上有n位学生,帅老师展示了m幅画,其中有些是梵高的作品,另外的都出自五岁小朋 ...