I just stumbled upon this old question as I had the same issue. In the end it was quite easy to get rid of the exception: Just call out.clear()
before:
out.clear();
...
// later, in a different method
ServletOutputStream out = response.getOutputStream();
...
out.clear()
also helped me to get rid of all those empty lines from <%@page import=...
and the like.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…