Failed to read HTTP message:org.springframework.http.converter.HttpMessageNotReadableException:Required request body Is Missing:public xxxxxxxx.
Source: Internet
Author: User
When using springBoot to develop recently, I used PostMan to access the interface and returned a 404 and reported a warn in the background:
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)
I checked each category, checked all possible places and found no errors. I found someone on the Internet on the left back and reported: Failed to write HTTP message error, the explanation is:
{
This exception is when I use Spring, I use the wrapper class Integer in JavaBean,
Private Integer pageNum; and the @ResponseBody annotation is used in the method,
The class com.fasterxml.jackson.databind.JsonMappingException in Spring when the return map returns to the foreground
This class will automatically unbox the packaging class into the corresponding basic type. If there is a null in the returned Integer, an error will be reported when unboxing into an int
If you assign null to the wrapper class Integer, and then assign Integer to the respective basic types, the compiler will not report, but you will encounter a null pointer exception during runtime.
This is caused by automatic unboxing in Java. Any wrapper class that contains a null value will throw a null pointer exception when Java unboxing to generate basic data types.
} Its blog link: 56014607
Write is such a reason, so read is a null value promise? ? ?
Here I use the vo class to receive parameters, and use the @requsetBody annotation, so the reason is similar to the above~~~
It turned out to be like this after an inspection. . . . .
Failed to read HTTP message: org.springframework.http.converter.HttpMessageNotReadableException: Required request body is missing: public xxxxxxxx.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.