2017-08-08 8 views
0

私はこのコードを呼び出すとき:HttpClientBuilder.build以内に見つからないorg.apache.http.conn.ssl.SSLConnectionSocketFactory()

HttpClientBuilder clientBuilder = HttpClientBuilder.create(); 
LaxRedirectStrategy laxStrategy = new LaxRedirectStrategy(); 
clientBuilder = clientBuilder.setRedirectStrategy(laxStrategy); 

httpClient = clientBuilder.build(); // FAILS HERE 

私はjava.lang.NoSuchFieldErrorのを取得:INSTANCE

は次のようになりますorg.apache.http.conn.ssl.SSLConnectionSocketFactoryクラスは見つかりませんが、そのクラスはクラスパス上のjarファイルにあります。どうしたら犯人を見つけることができますか?

ありがとうございます! Mike

答えて

0

これは私の依存関係の問題のようです。探しているクラスがCP上の2つの異なるジャーにあるかもしれません。

0

あなたのクラスパスにApache Commons HTTP Clientのバージョンが異なっています。あなたはjdk 8でバージョンを試すことができます。

<dependency> 
    <groupId>org.apache.httpcomponents</groupId> 
    <artifactId>httpclient</artifactId> 
    <version>4.1.1</version> 
</dependency> 
関連する問題