removing the chunked transfer encoding did not resolve.  try closing the...

... outputstream PrintWriter.
Not sure if related, but content length is not correct here, because of writer.println which adds a character or two