I've faced with same situation as http://sourceforge.net/forum/message.php?msg_id=4000087
Patch is attached - just changed getOutputStream() and getWriter():
public PrintWriter getWriter() throws IOException {
if(streamBuffer != null){
throw new IllegalStateException();
}
if (writerBuffer == null) {
writerBuffer = new StringWriter();
pw = new PrintWriter(writerBuffer);
}
return pw;
}
public ServletOutputStream getOutputStream() throws IOException {
if(writerBuffer != null){
throw new IllegalStateException();
}
if (streamBuffer == null) {
streamBuffer = new ByteArrayOutputStream();
sos = new ServletOutputStream() {
public void write(int b) throws IOException {
streamBuffer.write(b);
}
public void write(byte b[]) throws IOException {
streamBuffer.write(b);
}
public void write(byte b[], int off, int len) throws IOException {
streamBuffer.write(b, off, len);
}
};
}
return sos;
}