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 ...
随机推荐
- 页面传递的都是string ; 每个标签要有name的原因是为了取值 因为传递给后台是键值对的形式
页面传递的都是string ; 每个标签要有name的原因是为了取值 因为传递给后台是键值对的形式
- Js 中一系列宽度和高度的学习
在学习元素一系列宽度和高度之前,我们先来看一个平时开发中几乎不会遇到的问题,那就是html文档声明<!DOCTYPE html> 确实会对元素的宽高产生影响.几乎不会遇到,是因为我们在写h ...
- java读取excel获取数据写入到另外一个excel
pom.xml <?xml version="1.0" encoding="UTF-8"?> <project xmlns="htt ...
- float数组转字符串实施方案小记
float[] floats = {1.2f , 3.5f , 6.4f}; Double[] doubles = IntStream.range(0, floats.length).mapToDou ...
- Matplotlib学习---用wordcloud画词云(Word Cloud)
画词云首先需要安装wordcloud(生成词云)和jieba(中文分词). 先来说说wordcloud的安装吧,真是一波三折.首先用pip install wordcloud出现错误,说需要安装Vis ...
- 【XSY2709】count DP
题目描述 有一个序列\(A\),你可以随意排列这个序列,设\(s=\sum_{i=1}^{n-1}|a_i-a_{i+1}|\) . 问你最终\(s\leq m\)的方案数有几种. 保证\(A\)中的 ...
- ios-deploy was not found
Ionic 打包ios的时候,突然报错,提示如下: (node:1157) UnhandledPromiseRejectionWarning: ios-deploy was not found. Pl ...
- c# Redis 使用
1.服务端两个版本窗口版与安装windows服务版 1.1.窗口版 下载地址:https://github.com/dmajkic/redis/downloads redis-server.exe:服 ...
- MT【283】图像有唯一公共点.
函数$f(x)=\sqrt[n]x(n-\ln x),$其中$n\in N^*,x\in(0,+\infty)$.(1)若$n$为定值,求$f(x)$的最大值.(2)求证:对任意$m\in N^+$, ...
- SCOI2016幸运数字(树剖/倍增/点分治+线性基)
题目链接 loj luogu 题意 求树上路径最大点权异或和 自然想到(维护树上路径)+ (维护最大异或和) 那么有三种方法可以选择 1.树剖+线性基 2.倍增+线性基 3.点分治+线性基 至于线性基 ...