Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

software.amazon.awssdk.core.exception.SdkClientException

I'm getting this error below when I try to call a DynamoDB AWS service:

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

I'm using DynamoDbClient

My pom.xml:

       <dependency>
            <groupId>software.amazon.awssdk</groupId>
            <artifactId>dynamodb</artifactId>
        </dependency>
        <dependency>
            <groupId>software.amazon.awssdk</groupId>
            <artifactId>url-connection-client</artifactId>
        </dependency>

Client configuration:

@Singleton
public class DynamoClientConfig {

    @Produces
    @ApplicationScoped
    public DynamoDbClient getClientDb() {
        return DynamoDbClient.builder().region(Region.SA_EAST_1).build();
    }

I'm using Java and Quarkus.

Does anyone know what it could be and how to fix it?


2 Answers

Sorted out! I added the parameter in dynamodbclient and it worked.

.httpClient(UrlConnectionHttpClient.builder().build())

Actually it may be any compatible Http client. E.g. Apache Http client works for me:

import software.amazon.awssdk.http.apache.ApacheHttpClient;

CloudWatchLogsClient.builder.httpClient(ApacheHttpClient.builder().build()).build();
like image 32
Mitrakov Artem Avatar answered Feb 25 '26 04:02

Mitrakov Artem



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!