Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6421581

NPE while closing HttpExchange.getResonseBody()

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 6
    • 6
    • core-libs
    • None
    • b86
    • generic
    • generic

      HttpExchange.getResponseBody().close() throws NPE. This goes away when we uncomment the commented code. This is with http.jar that is integrated into JAXWS FCS.

      java.lang.NullPointerException
              at sun.net.httpserver.ChunkedOutputStream.close(ChunkedOutputStream.java:119)
              at sun.net.httpserver.PlaceholderOutputStream.close(ExchangeImpl.java:369)
              at Npe$1.handle(Npe.java:35)
              at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
              at sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:56)
              at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68)
              at sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:485)
              at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
              at java.lang.Thread.run(Thread.java:595)

      According to javadoc

      "Closing the OutputStream, implicitly closes the InputStream (if it is not already closed). "

      Attaching the program that produces this.

            michaelm Michael McMahon
            jkotamra Jitendra Kotamraju (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: