Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8248006 Revisit exceptions thrown when creating an HttpClient fails due to unavailability of underlying resources
  3. JDK-8251253

Release Note: HttpClient.newHttpClient and HttpClient.Builder.build Might Throw UncheckedIOException

XMLWordPrintable

    • Icon: Sub-task Sub-task
    • Resolution: Delivered
    • Icon: P4 P4
    • 16
    • 16
    • core-libs
    • 15
    • Verified

      Creation of an instance of `java.net.http.HttpClient` may fail with `UncheckedIOException` if the underlying resources required by the implementation cannot be allocated.

      Typically, this may happen if the underlying resources required to opening a `java.nio.channels.Selector` are not available. In this case `Selector.open()` will throw an `IOException` which the default implementation of `java.net.http.HttpClient` will wrap in an `UncheckedIOException`. The API documentation of `HttpClient.newHttpClient()` and `HttpClient.newBuilder().build()` have been updated to specify that `UncheckedIOException` may be thrown if the underlying resources required by the implementation cannot be allocated. Prior to this change, an undocumented `InternalError` would have been thrown.

       

            ryadav Rahul Yadav
            ryadav Rahul Yadav
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: