线程“Thread-3”中的异常 java.lang.NoSuchMethodError: org.apache.http.impl.client.DefaultRedirectStrategy.<init>([Ljava/lang/String;)V

问题描述

我正在使用 JDK 1.8Twilio 8.17.0 以及 HttpClient 4.5.12,但我仍然遇到同样的问题。请帮帮我。

线程“Thread-3”中的异常java.lang.NoSuchMethodError: org.apache.http.impl.client.DefaultRedirectStrategy.([Ljava/lang/String;)V

解决方法

如果您查看该构造函数 (https://hc.apache.org/httpcomponents-client-4.5.x/current/httpclient/apidocs/org/apache/http/impl/client/DefaultRedirectStrategy.html#DefaultRedirectStrategy(java.lang.String[])) 的 Javadoc,它会显示 Since 4.5.10

当您针对 4.5.12 进行编译时,我怀疑您使用的是不同的版本。