Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Meaning and solution for Spring 3 error message? "Using getResponseBodyAsStream instead is recommended"

I'm using Spring 3 and every time I submit a HTML form to a Spring controller I get this message, which I don't understand:

org.apache.commons.httpclient.HttpMethodBase getResponseBody
WARNING: Going to buffer response body of large or unknown size. 
Using getResponseBodyAsStream instead is recommended.

Is there a configuration change I can make in Spring to avoid this?

like image 690
Linc Avatar asked Sep 14 '10 22:09

Linc


People also ask

Should I use getresponsebodyasstream () or getresponsebody () method?

Using getResponseBodyAsStream instead is recommended. In the code I have to write the response to a byte array anyway, so it is the getResponseBody () method that I ought to use.

How to write custom error response for specific exceptions in spring?

Firstly, we understood that by default Spring returns a generic error message along with most suitable HTTP Status Code. However, we can write our own exception handlers for specific exceptions by using @ControllerAdvice and return a custom and detailed error response. For more on Spring and Spring Boot Tutorials, please visit Spring Tutorials.

What is responsestatusexception in spring 5?

Now Spring 5 introduces the ResponseStatusException class — a fast way for basic error handling in our REST APIs. All of these do have one thing in common: They deal with the separation of concerns very well.

What is defaulthandlerexceptionresolver in Spring Boot?

DefaultHandlerExceptionResolver This resolver was introduced in Spring 3.0, and it's enabled by default in the DispatcherServlet. It's used to resolve standard Spring exceptions to their corresponding HTTP Status Codes, namely Client error 4xx and Server error 5xx status codes.


1 Answers

You can add configuration http.method.response.buffer.warnlimit=1024*1024*10 in the application.properties. it works for me.

like image 82
Angle Tom Avatar answered Sep 21 '22 15:09

Angle Tom