software.amazon.awssdk.core.exception.SdkClientException

ner*_*ner 11 java amazon-web-services amazon-dynamodb spring-boot quarkus

当我尝试调用 DynamoDB AWS 服务时,出现以下错误:

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
Run Code Online (Sandbox Code Playgroud)

我正在使用DynamoDbClient

我的 pom.xml:

       <dependency>
            <groupId>software.amazon.awssdk</groupId>
            <artifactId>dynamodb</artifactId>
        </dependency>
        <dependency>
            <groupId>software.amazon.awssdk</groupId>
            <artifactId>url-connection-client</artifactId>
        </dependency>
Run Code Online (Sandbox Code Playgroud)

客户端配置:

@Singleton
public class DynamoClientConfig {

    @Produces
    @ApplicationScoped
    public DynamoDbClient getClientDb() {
        return DynamoDbClient.builder().region(Region.SA_EAST_1).build();
    }
Run Code Online (Sandbox Code Playgroud)

我正在使用 Java 和 Quarkus。

有谁知道这可能是什么以及如何解决它?

ner*_*ner 14

挑出来!我在 dynamodbclient 中添加了参数并且它起作用了。

.httpClient(UrlConnectionHttpClient.builder().build())
Run Code Online (Sandbox Code Playgroud)