简体   繁体   English

适用于ssm的aws java sdk提供了java.lang.NoSuchFieldError:SIGNING_REGION

[英]aws java sdk for ssm gives java.lang.NoSuchFieldError: SIGNING_REGION

Following code gives NoSuchFieldError when used in Lambda. 以下代码在Lambda中使用时给出NoSuchFieldError。 The same works in a simple java program. 在简单的Java程序中也是如此。 Appreciate any help.. 感谢任何帮助。

        AWSSimpleSystemsManagementAsync client = AWSSimpleSystemsManagementAsyncClientBuilder.defaultClient();

        PutParameterRequest putRequest = new PutParameterRequest();
        putRequest.setName("testKey");
        putRequest.setValue("testValue");
        client.putParameter(putRequest);

Digging into the source code shows error at AWSSimpleSystemsManagementClient.java -> request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion()); 深入研究源代码会显示AWSSimpleSystemsManagementClient.java-> request.addHandlerContext(HandlerContextKey.SIGNING_REGION,getSigningRegion())处的错误;

Also tried with AWSSimpleSystemsManagementClientBuilder.standard(); 还尝试过使用AWSSimpleSystemsManagementClientBuilder.standard(); AWSSimpleSystemsManagementClientBuilder.defaultClient(); AWSSimpleSystemsManagementClientBuilder.defaultClient();
WSSimpleSystemsManagementClientBuilder.standard().withRegion("us-east-1").build(); 。WSSimpleSystemsManagementClientBuilder.standard()withRegion( “美东-1”)构建(); returning the same error 返回相同的错误

Check that you have don't have a mistmach of aws versions. 检查您是否没有aws版本的错误信息。 you might be having the same issue I had, upgrading ssm aws version to 1.11.301 while other components had the 1.11.271 aws core version, causing the same exception. 您可能遇到了与我相同的问题,将ssm aws版本升级到1.11.301,而其他组件具有1.11.271 aws核心版本,会导致相同的异常。 You should make sure versions are aligned 您应该确保版本对齐

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM