-
Bug
-
Resolution: Fixed
-
P3
-
10
-
b20
Following test case fails
import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.ProxySelector;
import java.net.URI;
import java.net.URISyntaxException;
import jdk.incubator.http.HttpClient;
import jdk.incubator.http.HttpRequest;
import jdk.incubator.http.HttpResponse;
public class Get {
public static void main(String[] args)
throws IOException, URISyntaxException, InterruptedException
{
//HttpClient client = HttpClient.newHttpClient();
ProxySelector ps = ProxySelector.of(new InetSocketAddress("someproxy", 80));
System.out.println(ps);
HttpClient client = HttpClient.newBuilder()
.proxy(ps)
.build();
System.out.println(client.proxy().orElse(null));
HttpRequest request = HttpRequest.newBuilder()
.GET()
.uri(new URI("https://someuri/"))
.build();
HttpResponse<String> response
= client.send(request, HttpResponse.BodyHandler.asString());
System.out.println(response);
}
}
fails with ClassCastException.
The CCE probably was introduced by the last change to this code base.
import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.ProxySelector;
import java.net.URI;
import java.net.URISyntaxException;
import jdk.incubator.http.HttpClient;
import jdk.incubator.http.HttpRequest;
import jdk.incubator.http.HttpResponse;
public class Get {
public static void main(String[] args)
throws IOException, URISyntaxException, InterruptedException
{
//HttpClient client = HttpClient.newHttpClient();
ProxySelector ps = ProxySelector.of(new InetSocketAddress("someproxy", 80));
System.out.println(ps);
HttpClient client = HttpClient.newBuilder()
.proxy(ps)
.build();
System.out.println(client.proxy().orElse(null));
HttpRequest request = HttpRequest.newBuilder()
.GET()
.uri(new URI("https://someuri/"))
.build();
HttpResponse<String> response
= client.send(request, HttpResponse.BodyHandler.asString());
System.out.println(response);
}
}
fails with ClassCastException.
The CCE probably was introduced by the last change to this code base.
- duplicates
-
JDK-8200732 ClassCastException when performing a HTTP2 request though proxy
-
- Closed
-