JDK-6526158 : HttpExchange.getRequestBody().close() throws Exception
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.net
  • Affected Version: 6
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2007-02-16
  • Updated: 2010-04-03
  • Resolved: 2007-08-22
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
6u10 b02Fixed 7Fixed
HttpExchange.getRequestBody().close() throws the following excpetion when the data is not read from the InputStream. In Many cases, he application may not need anything from InputStream.

java.io.IOException: Stream is closed
        at sun.net.httpserver.FixedLengthInputStream.readImpl(FixedLengthInputStream.java:31)
        at sun.net.httpserver.LeftOverInputStream.drain(LeftOverInputStream.java:91)
        at sun.net.httpserver.LeftOverInputStream.close(LeftOverInputStream.java:48)

Attaching the program to produce it. Alos need the port of http.jar for JDK 1.5

EVALUATION fixing in 6u3. It is too late for 6u2.