-
Bug
-
Resolution: Duplicate
-
P3
-
None
-
9
public class SimpleConnectTest {
public static void main(String[] args) throws Exception {
String url = "..."; // This access won't return body
HttpClient client = HttpClient.create().version(Version.HTTP_2).build();
HttpRequest request = client.request(new URI(url)).GET();
HttpResponse<String> response = request.response(HttpResponse.BodyHandler.asString());
System.out.println(response.statusCode());
System.out.println(response.body());
}
}
Exception in thread "main" java.io.IOException: Queue closed
at java.net.http.Queue.take(java.httpclient@9-internal/Queue.java:113)
at java.net.http.Stream.lambda$receiveData$1(java.httpclient@9-internal/Stream.java:187)
at java.net.http.Stream.executeInline(java.httpclient@9-internal/Stream.java:164)
at java.net.http.Stream.receiveData(java.httpclient@9-internal/Stream.java:182)
at java.net.http.Stream.readBodyAsync(java.httpclient@9-internal/Stream.java:142)
at java.net.http.Stream.readBody(java.httpclient@9-internal/Stream.java:155)
at java.net.http.Exchange.readBody(java.httpclient@9-internal/Exchange.java:131)
at java.net.http.MultiExchange.response(java.httpclient@9-internal/MultiExchange.java:121)
at java.net.http.HttpRequestImpl.response(java.httpclient@9-internal/HttpRequestImpl.java:251)
at SimpleConnectTest.main(SimpleConnectTest.java:13)
public static void main(String[] args) throws Exception {
String url = "..."; // This access won't return body
HttpClient client = HttpClient.create().version(Version.HTTP_2).build();
HttpRequest request = client.request(new URI(url)).GET();
HttpResponse<String> response = request.response(HttpResponse.BodyHandler.asString());
System.out.println(response.statusCode());
System.out.println(response.body());
}
}
Exception in thread "main" java.io.IOException: Queue closed
at java.net.http.Queue.take(java.httpclient@9-internal/Queue.java:113)
at java.net.http.Stream.lambda$receiveData$1(java.httpclient@9-internal/Stream.java:187)
at java.net.http.Stream.executeInline(java.httpclient@9-internal/Stream.java:164)
at java.net.http.Stream.receiveData(java.httpclient@9-internal/Stream.java:182)
at java.net.http.Stream.readBodyAsync(java.httpclient@9-internal/Stream.java:142)
at java.net.http.Stream.readBody(java.httpclient@9-internal/Stream.java:155)
at java.net.http.Exchange.readBody(java.httpclient@9-internal/Exchange.java:131)
at java.net.http.MultiExchange.response(java.httpclient@9-internal/MultiExchange.java:121)
at java.net.http.HttpRequestImpl.response(java.httpclient@9-internal/HttpRequestImpl.java:251)
at SimpleConnectTest.main(SimpleConnectTest.java:13)