Azure Service Bus for Java

0

I have to program a client of an Azure Service Bus broker, in Java. The problem that arises is that I get this error when I start the application:

  

java.lang.ClassNotFoundException: org.apache.http.impl.client.HttpClientBuilder

and I have no idea why. And the line of code that gives error is:

>     Configuration config = ServiceBusConfiguration.configureWithSASAuthentication(Endpoint,SharedAccessKeyName,SharedAccessKey,".servicebus.windows.net");
>     service = ServiceBusService.create(config);

To develop it I am starting from the Microsoft example that can be found here: link

I have taken all azure libraries that come in the POM.xml (all under the phrase "Azure Java SDK libraries"): link

Does anyone have any idea what may be happening? The documentation for Microsoft on Azure Service Bus for Java leaves a lot to be desired: (

Could it be a problem with the versions?

    
asked by jjmartinez 20.03.2017 в 13:52
source

1 answer

1

Given the error, you're missing the Apache library that contains that class. Adding this to the POM should work:

<dependency>
    <groupId>org.apache.httpcomponents</groupId>
    <artifactId>httpclient</artifactId>
    <version>4.3.4</version>
</dependency>

I hope it works for you, best regards!

    
answered by 21.03.2017 / 08:22
source