Получить исключение при создании Bean of AmazonSNS
Я хочу обновить мою версию aws-java-sdk до 1.11.335, но получить исключение при создании Bean of AmazonSNS
Код создания бина:
@Bean(name = "amazonSnsClient")
public AmazonSNS amazonSNSClient() {
AmazonSNS snsClient = AmazonSNSClient.builder().withRegion(Regions.fromName(snsConfig.getRegion())).build();
return snsClient;
}
Используя класс
@Autowired
@Qualifier("amazonSnsClient")
private AmazonSNS snsClient;
в pom.xml
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk</artifactId>
<version>1.11.335</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.2</version>
<scope>runtime</scope>
</dependency>
получить исключение
Caused by: java.lang.NoClassDefFoundError: org/apache/http/conn/ConnectionKeepAliveStrategy
at com.amazonaws.http.AmazonHttpClient.<clinit>(AmazonHttpClient.java:149) ~[Server.jar:na]
at com.amazonaws.AmazonWebServiceClient.<init>(AmazonWebServiceClient.java:175) ~[Server.jar:na]
at com.amazonaws.services.sns.AmazonSNSClient.<init>(AmazonSNSClient.java:251) ~[Server.jar:na]
at com.amazonaws.services.sns.AmazonSNSClientBuilder.build(AmazonSNSClientBuilder.java:60) ~[Server.jar:na]
at com.amazonaws.services.sns.AmazonSNSClientBuilder.build(AmazonSNSClientBuilder.java:26) ~[Server.jar:na]
at com.amazonaws.client.builder.AwsSyncClientBuilder.build(AwsSyncClientBuilder.java:46) ~[Server.jar:na]