Repository navigation
Closed
Description
Type: Bug
Component:
S3
Describe the bug
When used in combination with Spring-AI with its AWS Bedrock dependencies, the version of AWSSDK that gets pulled in is (as of this date, with Spring AI v 2.0.1) 2.51.2. Spring Cloud AWS requests version 2.47.4, but gradle picks the newer version of the SDK that Spring AI wants, and so, AWSSDK 2.51.2 ends up on the classpath instead of 2.47.4. When using S3Template, with AWS SDK 2.51.2, the following exception occurs:
java.lang.AbstractMethodError: Receiver class software.amazon.awssdk.services.s3.DefaultS3Client$$Lambda/0x0000000017e3c4e0 does not define or inherit an implementation of the resolved method 'abstract java.util.List resolve(software.amazon.awssdk.core.SdkRequest, software.amazon.awssdk.core.interceptor.ExecutionAttributes)' of interface software.amazon.awssdk.core.spi.identity.AuthSchemeOptionsResolver.
at software.amazon.awssdk.core.internal.http.pipeline.stages.AuthSchemeResolutionStage.resolveAuthSchemeOptions(AuthSchemeResolutionStage.java:117)
at software.amazon.awssdk.core.internal.http.pipeline.stages.AuthSchemeResolutionStage.execute(AuthSchemeResolutionStage.java:70)
at software.amazon.awssdk.core.internal.http.pipeline.stages.AuthSchemeResolutionStage.execute(AuthSchemeResolutionStage.java:50)
at software.amazon.awssdk.core.internal.http.pipeline.RequestPipelineBuilder$ComposingRequestPipelineStage.execute(RequestPipelineBuilder.java:206)
at software.amazon.awssdk.core.internal.http.pipeline.RequestPipelineBuilder$ComposingRequestPipelineStage.execute(RequestPipelineBuilder.java:206)
at software.amazon.awssdk.core.internal.http.pipeline.RequestPipelineBuilder$ComposingRequestPipelineStage.execute(RequestPipelineBuilder.java:206)
at software.amazon.awssdk.core.internal.http.pipeline.RequestPipelineBuilder$ComposingRequestPipelineStage.execute(RequestPipelineBuilder.java:206)
at software.amazon.awssdk.core.internal.http.pipeline.RequestPipelineBuilder$ComposingRequestPipelineStage.execute(RequestPipelineBuilder.java:206)
at software.amazon.awssdk.core.internal.http.pipeline.RequestPipelineBuilder$ComposingRequestPipelineStage.execute(RequestPipelineBuilder.java:206)
at software.amazon.awssdk.core.internal.http.StreamManagingStage.execute(StreamManagingStage.java:53)
at software.amazon.awssdk.core.internal.http.StreamManagingStage.execute(StreamManagingStage.java:35)
at software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallTimeoutTrackingStage.executeWithTimer(ApiCallTimeoutTrackingStage.java:82)
at software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallTimeoutTrackingStage.execute(ApiCallTimeoutTrackingStage.java:62)
at software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallTimeoutTrackingStage.execute(ApiCallTimeoutTrackingStage.java:43)
at software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallMetricCollectionStage.execute(ApiCallMetricCollectionStage.java:49)
at software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallMetricCollectionStage.execute(ApiCallMetricCollectionStage.java:32)
at software.amazon.awssdk.core.internal.http.pipeline.RequestPipelineBuilder$ComposingRequestPipelineStage.execute(RequestPipelineBuilder.java:206)
at software.amazon.awssdk.core.internal.http.pipeline.RequestPipelineBuilder$ComposingRequestPipelineStage.execute(RequestPipelineBuilder.java:206)
at software.amazon.awssdk.core.internal.http.pipeline.stages.ExecutionFailureExceptionReportingStage.execute(ExecutionFailureExceptionReportingStage.java:37)
at software.amazon.awssdk.core.internal.http.pipeline.stages.ExecutionFailureExceptionReportingStage.execute(ExecutionFailureExceptionReportingStage.java:26)
at software.amazon.awssdk.core.internal.http.AmazonSyncHttpClient$RequestExecutionBuilderImpl.execute(AmazonSyncHttpClient.java:214)
at software.amazon.awssdk.core.internal.handler.BaseSyncClientHandler.invoke(BaseSyncClientHandler.java:103)
at software.amazon.awssdk.core.internal.handler.BaseSyncClientHandler.doExecute(BaseSyncClientHandler.java:173)
at software.amazon.awssdk.core.internal.handler.BaseSyncClientHandler.lambda$execute$0(BaseSyncClientHandler.java:66)
at software.amazon.awssdk.core.internal.handler.BaseSyncClientHandler.measureApiCallSuccess(BaseSyncClientHandler.java:182)
at software.amazon.awssdk.core.internal.handler.BaseSyncClientHandler.execute(BaseSyncClientHandler.java:60)
at software.amazon.awssdk.core.client.handler.SdkSyncClientHandler.execute(SdkSyncClientHandler.java:52)
at software.amazon.awssdk.awscore.client.handler.AwsSyncClientHandler.execute(AwsSyncClientHandler.java:60)
at software.amazon.awssdk.services.s3.DefaultS3Client.getObject(DefaultS3Client.java:7332)
at software.amazon.awssdk.services.s3.S3Client.getObject(S3Client.java:12513)
at software.amazon.awssdk.services.s3.S3Client.getObject(S3Client.java:12779)
at io.awspring.cloud.s3.S3Resource.getInputStream(S3Resource.java:106)
Dependencies:
io.awspring.cloud:spring-cloud-aws-starter-s3:4.1.0io.awspring.cloud:spring-cloud-aws-starter-sqs:4.1.0org.springframework.ai:spring-ai-autoconfigure-model-tool:2.0.1org.springframework.ai:spring-ai-starter-model-bedrock:2.0.1org.springframework.ai:spring-ai-starter-model-bedrock-converse:2.0.1
Temporary Workaround:
in build.gradle.kts, to force use of 2.47.4:
implementation(enforcedPlatform( "io.awspring.cloud:spring-cloud-aws-dependencies:4.1.0"))
Ideally spring cloud aws requests or can work with the same version of awssdk that Spring-AI's bedrock deps pull in.
Reacted by Damien, Francisco Melicias, matthieu-gabin, Francisco Melicias, Ines and Térence Laurent
Metadata
Metadata
Assignees
Labels
No labels
Activity
franciscomelicias commentedon Aug 25, 2026
We are having the same issue in our project. Would be nice if we can do the upgrade so we can use the new version of Spring-AI
mschout commentedon Aug 25, 2026
Bit more info after asking codex to trace down the incompatibility here, as the stack trace is deep inside the AWS SDK.
The resolved runtime classpath has:
And so, this is a binary incompatible mixture of AWS SDK dependencies.
The failure mechanism (at least for my reported stacktrace) is is triggered by
S3Resource.getInputStream()under this scenario.S3 2.47.4-generated lambda:
SDK Core 2.51.2 expects:
When the newer
AuthSchemeResolutionStageinvokes the two-argument method, the lambda generated by the olderDefaultS3Clientcannot implement it, producingAbstractMethodError. The trace is deep inside AWS because authentication resolution is the first point where that incompatible interface gets invoked.S3Resource.getInputStream()merely initiates the request.Spring Cloud AWS itself is behaving normally.
The question then is what to do about it, and yes, ideally both Spring-AI and Spring Cloud AWS request the same SDK version. But meanwhile the choice is:
Hopefully the public API's are compatible between these two versions of the SDK.
One way in gradle was the temporary workaround I posted earlier using
enforcedPlatform. The other way would be to pick the SDK version that Spring-AI uses. Unforutnately, there is no easy way to pick the AWS SDK version out of the Spring-AI BOM that I could find so it has to be specified explicitly:e.g. in
gradle/libs.versions.toml:and then in
build.gradle.kts:And I would hope that any incompatibility is caught by a compile time error beyond that.
mschout commentedon Aug 25, 2026
Not sure how to do the equivalent in maven for anyone that needs it. I'm using gradle, sorry.
MatejNedic commentedon Aug 25, 2026
Hey @mschout ,
We are planning on doing release of 4.1.1 very soon so we will lift the dependency version.
MatejNedic commentedon Aug 28, 2026
Hello everyone.
4.1.1 has been released with latest version of AWS sdk!
Closing the issue.