diff --git a/clientlibs/java/src/main/java/org/upgradeplatform/utils/APIService.java b/clientlibs/java/src/main/java/org/upgradeplatform/utils/APIService.java index 15c0359b55..2c7158163c 100644 --- a/clientlibs/java/src/main/java/org/upgradeplatform/utils/APIService.java +++ b/clientlibs/java/src/main/java/org/upgradeplatform/utils/APIService.java @@ -10,9 +10,8 @@ import javax.ws.rs.client.ClientBuilder; import javax.ws.rs.core.MediaType; -import org.glassfish.jersey.apache.connector.ApacheConnectorProvider; -import org.glassfish.jersey.client.ClientConfig; import org.glassfish.jersey.client.ClientProperties; +import org.glassfish.jersey.client.HttpUrlConnectorProvider; public class APIService implements AutoCloseable{ @@ -36,7 +35,7 @@ public APIService(String baseUrl, String authToken, String sessionId, Map properties) { - Client client = ClientBuilder.newClient(new ClientConfig().connectorProvider(new ApacheConnectorProvider())); + Client client = ClientBuilder.newClient(); client.property(ClientProperties.CONNECT_TIMEOUT, 3000); client.property(ClientProperties.READ_TIMEOUT, 3000); properties.entrySet().stream() @@ -58,6 +57,7 @@ public AsyncInvoker prepareRequest(String apiPath) { .request(MediaType.APPLICATION_JSON) .header("Authorization", "Bearer "+this.authToken) .header("Session-Id", this.sessionId) + .property(HttpUrlConnectorProvider.SET_METHOD_WORKAROUND, true) .async(); }