You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Jean-Baptiste Onofré <jb...@nanthrax.net> on 2021/10/01 12:10:24 UTC

Re: Using ServiceMix Azure bundles to upload blobs fails: request was made to load the default HttpClient provider but one could not be found on the classpath

Hi Robert,

I'm about to release azure-core-http-netty and azure-core-http-okhttp 
bundles.

Regards
JB

On 01/10/2021 14:08, Robert Munteanu wrote:
> Hi,
> 
> I am trying to deploy the ServiceMix Azure bundles in an Apache Felix
> based app. The application interacts with Azure Storage, and I'm trying
> a simple example to upload a blob.
> 
> I have the following bundles defined:
> 
> - org.apache.servicemix.bundles/org.apache.servicemix.bundles.azure-
> storage-blob/12.12.0_1
> - org.apache.servicemix.bundles/org.apache.servicemix.bundles.azure-
> storage-common/12.12.0_1
> - org.apache.servicemix.bundles/org.apache.servicemix.bundles.azure-
> core/1.17.0_1
> 
> When trying to upload a blob I get the following:
> 
> 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:51)
> 	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:62)
> 	at com.azure.storage.blob.implementation.util.BuilderHelper.buildPipeline(BuilderHelper.java:135)
> 	at com.azure.storage.blob.BlobServiceClientBuilder.buildAsyncClient(BlobServiceClientBuilder.java:114)
> 	at com.azure.storage.blob.BlobServiceClientBuilder.buildClient(BlobServiceClientBuilder.java:90)
> 
> I checked and neither azure-core-http-netty nor azure-core-http-okhttp
> are available as OSGi bundles. I can always fallback to wrapping those
> bundles, but I was wondering whether someone has a better approach,
> given that some parts of the Azure SDK is already OSGified in
> ServiceMix.
> 
> Thanks!
> Robert
> 

Re: Using ServiceMix Azure bundles to upload blobs fails: request was made to load the default HttpClient provider but one could not be found on the classpath

Posted by Robert Munteanu <ro...@apache.org>.
Hi JB,

Great news, I'll wait for the release to go through.

Thanks!
Robert

On Fri, 2021-10-01 at 14:10 +0200, Jean-Baptiste Onofré wrote:
> Hi Robert,
> 
> bundles.
> 
> Regards
> JB
> 
> On 01/10/2021 14:08, Robert Munteanu wrote:
> > Hi,
> > 
> > I am trying to deploy the ServiceMix Azure bundles in an Apache
> > Felix
> > based app. The application interacts with Azure Storage, and I'm
> > trying
> > a simple example to upload a blob.
> > 
> > I have the following bundles defined:
> > 
> > -
> > org.apache.servicemix.bundles/org.apache.servicemix.bundles.azure-
> > storage-blob/12.12.0_1
> > -
> > org.apache.servicemix.bundles/org.apache.servicemix.bundles.azure-
> > storage-common/12.12.0_1
> > -
> > org.apache.servicemix.bundles/org.apache.servicemix.bundles.azure-
> > core/1.17.0_1
> > 
> > When trying to upload a blob I get the following:
> > 
> > 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.createInstan
> > ce(HttpClientProviders.java:51)
> >         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.j
> > ava:62)
> >         at
> > com.azure.storage.blob.implementation.util.BuilderHelper.buildPipel
> > ine(BuilderHelper.java:135)
> >         at
> > com.azure.storage.blob.BlobServiceClientBuilder.buildAsyncClient(Bl
> > obServiceClientBuilder.java:114)
> >         at
> > com.azure.storage.blob.BlobServiceClientBuilder.buildClient(BlobSer
> > viceClientBuilder.java:90)
> > 
> > I checked and neither azure-core-http-netty nor azure-core-http-
> > okhttp
> > are available as OSGi bundles. I can always fallback to wrapping
> > those
> > bundles, but I was wondering whether someone has a better approach,
> > given that some parts of the Azure SDK is already OSGified in
> > ServiceMix.
> > 
> > Thanks!
> > Robert
> >