当我们的项目中集成了多个AWS相关Jar包时,有可能就会遇到这个错误:
错误信息:
There is an issue with the connector
Code: InvalidInput.InvalidConnectorConfiguration
Message: The connector configuration is invalid. Message: Multiple HTTP implementations were found on the classpath. To avoid non-deterministic loading implementations, please explicitly provide an HTTP client via the client builders, set the software.amazon.awssdk.http.service.impl system property with the FQCN of the HTTP service to use as the default, or remove all but one HTTP implementation from the classpath
产生这个错误的原因是:不同的AWS的Jar包可能会使用不同的AWS SDK去和不同的服务进行交互,这种交互底层是通过RestAPI完成的,所以所有的AWS SDK都会依赖到一个Http Client。目前AWS SDK一共支持4种类型的Http Client,分别是:
- ApacheHttpClient
- UrlConnectionHttpClient
- NettyNioAsyncHttpClient
- AwsCrtAsyncHttpClient