4

我正在尝试使用 STS 服务进行登机,但我得到了 LambdaConversionException @resolveCredentials

StsClient stsClient = StsClient.builder().credentialsProvider(sp_StaticCredentialsProvider).build();
StsAssumeRoleCredentialsProvider assumeRoleCredentialProvider = 
                    StsAssumeRoleCredentialsProvider.builder()
                    .stsClient(stsClient)
                    .refreshRequest(assumeRoleRequest)
                    .build();
AwsCredentials clientCredentials = assumeRoleCredentialProvider.resolveCredentials();

我依赖于以下工件

  • 软件.amazon.awssdk - 2.9.16
  • 软件.amazon.awssdk - sts - 2.9.16
  • org.apache.httpcomponents - httpclient - 4.5.10
  • org.apache.httpcomponents - httpcore - 4.4.12

异常堆栈跟踪

Exception in thread "main" java.lang.BootstrapMethodError: call site initialization exception
    at software.amazon.awssdk.services.sts.auth.StsCredentialsProvider.resolveCredentials(StsCredentialsProvider.java:78)
    at software.amazon.awssdk.services.sts.auth.StsAssumeRoleCredentialsProvider.resolveCredentials(StsAssumeRoleCredentialsProvider.java:42)
    at com.silverpeak.gms.server2.manager.thirdPartyTunnels.AWSGlobalInterconnectTest.main(AWSGlobalInterconnectTest.java:43)
Caused by: java.lang.invoke.LambdaConversionException: Invalid receiver type interface org.apache.http.Header; not a subtype of implementation type interface org.apache.http.NameValuePair

感谢任何帮助。

4

2 回答 2

3

升级到最新版本httpcore

<!-- https://mvnrepository.com/artifact/org.apache.httpcomponents/httpcore -->
<dependency>
    <groupId>org.apache.httpcomponents</groupId>
    <artifactId>httpcore</artifactId>
    <version>4.4.14</version>
</dependency>

我敢肯定,操作员现在一定已经解决了,将其发布在同一条船上的其他人。

于 2021-01-25T22:05:49.550 回答
0

我有一个类似的问题。就我而言,这是由于 httpclient 和 httpcore 依赖项版本冲突。解决版本冲突后,问题解决了

于 2021-10-07T19:41:26.597 回答