Reputation: 1
HttpComponentsClientHttpRequestFactory requestFactory = new HttpComponentsClientHttpRequestFactory(httpClient());
'HttpComponentsClientHttpRequestFactory(org.apache.hc.client5.http.classic.HttpClient)' in 'org.springframework.http.client.HttpComponentsClientHttpRequestFactory' cannot be applied to '(org.apache.http.client.HttpClient)'
Need solution to solve this in any other alternative way with this dependency specifically.
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.2</version>
</dependency>
Upvotes: 0
Views: 460
Reputation: 177
As mentioned in the Migration Guide, support for Apache HttpClient has been removed in Spring Framework 6.0, immediately replaced by org.apache.httpcomponents.client5:httpclient5. It is not possible to use apache httpclient 4.x versions along with spring 6.x version.
Upvotes: 0