diff --git a/fe/fe-core/src/main/java/com/starrocks/StarRocksFE.java b/fe/fe-core/src/main/java/com/starrocks/StarRocksFE.java index 306c8d431a1..7d50b7422bd 100644 --- a/fe/fe-core/src/main/java/com/starrocks/StarRocksFE.java +++ b/fe/fe-core/src/main/java/com/starrocks/StarRocksFE.java @@ -180,6 +180,17 @@ public class StarRocksFE { addShutdownHook(); + // To resolve: "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" + // Currently, there are 2 implements of HTTP client: ApacheHttpClient and UrlConnectionHttpClient + // The UrlConnectionHttpClient is introduced by #16602, and it causes the exception. + // So we set the default HTTP client to UrlConnectionHttpClient. + // TODO: remove this after we remove ApacheHttpClient + System.setProperty("software.amazon.awssdk.http.service.impl", + "software.amazon.awssdk.http.urlconnection.UrlConnectionSdkHttpService"); + LOG.info("FE started successfully"); while (!stopped) { diff --git a/fe/fe-core/src/main/java/com/starrocks/connector/iceberg/glue/IcebergAwsClientFactory.java b/fe/fe-core/src/main/java/com/starrocks/connector/iceberg/IcebergAwsClientFactory.java similarity index 97% rename from fe/fe-core/src/main/java/com/starrocks/connector/iceberg/glue/IcebergAwsClientFactory.java rename to fe/fe-core/src/main/java/com/starrocks/connector/iceberg/IcebergAwsClientFactory.java index 55ee0fc193a..dce6c79940b 100644 --- a/fe/fe-core/src/main/java/com/starrocks/connector/iceberg/glue/IcebergAwsClientFactory.java +++ b/fe/fe-core/src/main/java/com/starrocks/connector/iceberg/IcebergAwsClientFactory.java @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package com.starrocks.connector.iceberg.glue; +package com.starrocks.connector.iceberg; import com.google.common.base.Preconditions; import org.apache.iceberg.aws.AwsClientFactory; @@ -116,7 +116,6 @@ public class IcebergAwsClientFactory implements AwsClientFactory { String region) { // Build sts client StsClientBuilder stsClientBuilder = StsClient.builder().credentialsProvider(baseCredentials); - stsClientBuilder.applyMutation(awsProperties::applyHttpClientConfigurations); if (!region.isEmpty()) { stsClientBuilder.region(Region.of(region)); } @@ -159,8 +158,6 @@ public class IcebergAwsClientFactory implements AwsClientFactory { s3ClientBuilder.endpointOverride(URI.create(s3Endpoint)); } - s3ClientBuilder.applyMutation(awsProperties::applyHttpClientConfigurations); - return s3ClientBuilder.build(); } @@ -185,7 +182,6 @@ public class IcebergAwsClientFactory implements AwsClientFactory { glueClientBuilder.endpointOverride(URI.create(glueEndpoint)); } - glueClientBuilder.applyMutation(awsProperties::applyHttpClientConfigurations); return glueClientBuilder.build(); } diff --git a/fe/fe-core/src/main/java/com/starrocks/connector/iceberg/glue/IcebergGlueCatalog.java b/fe/fe-core/src/main/java/com/starrocks/connector/iceberg/glue/IcebergGlueCatalog.java index 376a04ea90b..6a80c3f1bf5 100644 --- a/fe/fe-core/src/main/java/com/starrocks/connector/iceberg/glue/IcebergGlueCatalog.java +++ b/fe/fe-core/src/main/java/com/starrocks/connector/iceberg/glue/IcebergGlueCatalog.java @@ -20,6 +20,7 @@ import com.google.common.collect.Maps; import com.starrocks.catalog.Database; import com.starrocks.common.MetaNotFoundException; import com.starrocks.connector.exception.StarRocksConnectorException; +import com.starrocks.connector.iceberg.IcebergAwsClientFactory; import com.starrocks.connector.iceberg.IcebergCatalog; import com.starrocks.connector.iceberg.IcebergCatalogType; import com.starrocks.connector.iceberg.cost.IcebergMetricsReporter;