Home > Back-end >  GetWriter () has already had called for this response
GetWriter () has already had called for this response

Time:02-05


Problem description: this interface code is springboot use feign call other micro service flow PDF file, then an interface of the browser preview PDF, debug the IDE without figure of res. Reset () is ok, but the packaging is deployed to the test on Linux, this interface print error log appear getWriter () has already had called for this response errors, the method first sentence plus res. The reset () is solved, but my response object does not use getWriter this way,
B: where is Montana altar in the root cause of problem,

CodePudding user response:

You have no getWriter method, but you can't guarantee framework in other areas there is adjustable, namely framework calls outPDF to how your res, you can't guarantee, so you can't see your own code, light between modules of the framework to consider is how to call, that is what is in front of the incoming status of the incoming parameters, also want to understand,

CodePudding user response:

reference 1st floor qybao response:
you have no getWriter method, but you can't guarantee framework in other areas there is adjustable, namely framework calls outPDF to how your res, you can't guarantee, so you can't see your own code, light between modules of the framework to consider is how to call, that is what is in front of the incoming status of the incoming parameters, also want to understand,
thank you for your reply, that makes sense, I also want to is this, what do you mean, the framework of httpservletResponse returned to me the res objects, whether the method has been called a writer before, that I also look at the code, is not found, the res. The reset () is the first sentence, I understand the response object to get the writer before, but there is a problem, I this code, without res. The reset () in the local can be smoothly adjusted, but on Linux, not line, must add this sentence, the other the same code, on the another service colleagues, do not add res. Reset the, deployed on Linux, or can run through, struggle,,,
  • Related