Spring controller returns 500 server errors after updating Spring version to 4.2.3

I used the Spring version 4.1.8.RELEASEwithout any problems in my application. I have a basic setup with Spring controllers that serve as REST resources and have defined the following resource:

@RequestMapping(
            value = "/emailvalidation",
            method = RequestMethod.POST)
public ResponseEntity userEmailValidation(
            @Valid @RequestBody UserEmailValidationRequest request, BindingResult bindingResult) {
    validator.validate(ErrorCode.class, bindingResult);

    backendClient().validateUserEmail(request);

    return new ResponseEntity(HttpStatus.NO_CONTENT);
}

It was a properly working resource, and in the case of validation validation, it returned a successful response with an HTTP status of 201.

The problem is that after upgrading to a 4.2.3.RELEASEresource, the resource always returns an HTTP status of 500.

Is there a new way to handle such resources where I want to make a POST, however there is no response data? I could not find any updates about this, nor about any problem.

+4
2

, Runtime, - 500.

LoggingFilter, org.springframework.web.filter.OncePerRequestFilter. , (. )

byte[] responseData = response.getOutputBuffer();
String payload = new String(responseData).replace("\n", "");
message.append(";payload=").append(payload);

4.2 response.getOutputBuffer() byte[0], , . 4.2. *, null . NullPointerException, 500 Server Error.

+1

NullPointerException. - . Spring Framework. , .

500: SRVE0295E: : 500

0

Source: https://habr.com/ru/post/1620374/


All Articles