Java AWS SDK v2 STS-BootstrapMethodError:由LamdaConversionException引起的调用站点初始化异常

Java AWS SDK v2 STS-BootstrapMethodError:由LamdaConversionException引起的调用站点初始化异常,java,aws-sdk,aws-sts,Java,Aws Sdk,Aws Sts,我正在尝试使用STS服务进行登机,我获得了LambdaConversionException@resolveCredentials StsClient stsClient = StsClient.builder().credentialsProvider(sp_StaticCredentialsProvider).build(); StsAssumeRoleCredentialsProvider assumeRoleCredentialProvider =

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

StsClient stsClient = StsClient.builder().credentialsProvider(sp_StaticCredentialsProvider).build();
StsAssumeRoleCredentialsProvider assumeRoleCredentialProvider = 
                    StsAssumeRoleCredentialsProvider.builder()
                    .stsClient(stsClient)
                    .refreshRequest(assumeRoleRequest)
                    .build();
AwsCredentials clientCredentials = assumeRoleCredentialProvider.resolveCredentials();
我依赖于下面的工件

  • software.amazon.awssdk-2.9.16
  • software.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

感谢您的帮助。

升级至最新版本的
httpcore

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

org.apache.httpcomponents
httpcore
4.4.14
我相信op现在一定已经解决了,把它贴在这里给同一条船上的其他人看