Azure Java SDK unable to find default HttpClient provider

Copper Contributor

I'm using the azure-resourcemanager-compute (Version 2.8.0) library and trying to authenticate it using client credentials. I'm getting the following  exception even though I have included both

azure-core-http-netty (Version 1.11.4) and azure-core-http-okhttp (Version 1.7.6) as dependencies.

 

Caused by: java.lang.IllegalStateException: A request was made to load the default HttpClient provider but one could not be found on the classpath. If you are using a dependency manager, consider including a dependency on azure-core-http-netty or azure-core-http-okhttp. Depending on your existing dependencies, you have the choice of Netty or OkHttp implementations. Additionally, refer to https://aka.ms/azsdk/java/docs/custom-httpclient to learn about writing your own implementation.

at com.azure.core.implementation.http.HttpClientProviders.createInstance(HttpClientProviders.java:60)
at com.azure.core.http.HttpClient.createDefault(HttpClient.java:50)
at com.azure.core.http.HttpClient.createDefault(HttpClient.java:40)
at com.azure.core.http.HttpPipelineBuilder.build(HttpPipelineBuilder.java:73)
at com.azure.resourcemanager.resources.fluentcore.utils.HttpPipelineProvider.buildHttpPipeline(HttpPipelineProvider.java:87)
at com.azure.resourcemanager.resources.fluentcore.utils.HttpPipelineProvider.buildHttpPipeline(HttpPipelineProvider.java:46)
at com.azure.resourcemanager.compute.ComputeManager.authenticate(ComputeManager.java:100)

 

0 Replies