Vonage / vonage-java-sdk

Vonage Server SDK for Java. API support for SMS, Messages, Voice, Text-to-Speech, Numbers, Verify (2FA), Video and more.
https://developer.vonage.com/en/home
Apache License 2.0
97 stars 121 forks source link

make-phone-calls fail #155

Closed daniel-chan closed 5 years ago

daniel-chan commented 6 years ago

public static void test() throws Exception { NexmoClient client = new NexmoClient(new JWTAuthMethod( "e1e8bf22-c728-44fa-9a9c-4863ca7409ab", FileSystems.getDefault().getPath("D:\private.key") ));

    client.getVoiceClient().createCall(new Call(
            "85259259059",
            "447418341645",
            "http://ap2.santo.cc/mo/nexmo"
    ));
}

call this method ,result exception as below: Exception in thread "main" java.lang.NoSuchMethodError: org.apache.http.client.methods.RequestBuilder.post(Ljava/lang/String;)Lorg/apache/http/client/methods/RequestBuilder; at com.nexmo.client.voice.endpoints.CreateCallMethod.makeRequest(CreateCallMethod.java:54) at com.nexmo.client.voice.endpoints.CreateCallMethod.makeRequest(CreateCallMethod.java:40) at com.nexmo.client.voice.endpoints.AbstractMethod.execute(AbstractMethod.java:81) at com.nexmo.client.voice.endpoints.CallsEndpoint.post(CallsEndpoint.java:64) at com.nexmo.client.voice.VoiceClient.createCall(VoiceClient.java:69)

cr0wst commented 6 years ago

Hi @daniel-chan, I wonder if you might be pulling in an earlier version of org.apache.httpcomponents:httpclient. The post method was added to RequestBuilder in version 4.4 of this dependency. Do you have this dependency specified in your build.gradle or pom.xml already?