Issue
I'm creating a Springboot microservice that is attempting to query a table stored in DynamoDB, I can get the table and its contents just fine using the AWS CLI, however when I try to do it through my micro service using IntelliJ, I receive this error that has almost no trace on the internet.
[Handler dispatch failed; nested exception is java.lang.ExceptionInInitializerError] with root cause
java.lang.IllegalArgumentException: No duplicate ExecutionAttribute names allowed but both ExecutionAttributes 528c2979 and 6970b040 have the same name: DualstackEndpointsEnabled. ExecutionAttributes should be referenced from a shared static constant to protect against erroneous or unexpected collisions.
I have tried so many things with no avail, first moving from IntelliJ to launching the app through the command line using Maven manually to VSCode, I uninstalled the IntelliJ DynamoDB plugin thinking it might be interfering with this, killed AWS processes running on port 443 which is what AWS usually runs on, keep in mind the issue occurred before I even had the AWS CLI on my machine so I don't think having that installed would interfere with my workflow, and it would be a very odd decision if it did.
the code is very basic, just making a call using a channel name stored in the database, here is a snippet of the base method being called if it helps identify the issue
public PageIterable<DynamoOrder> getOrdersByChannel(String channelName) {
DynamoDbTable<DynamoOrder> orderTable = getTable();
AttributeValue channelNameAttribute = AttributeValue.builder().s(channelName).build();
Expression expression = Expression.builder().expression("marketplaceChannelName = :v_marketplaceChannelName")
.putExpressionValue(":v_marketplaceChannelName", channelNameAttribute).build();
return orderTable.scan(ScanEnhancedRequest.builder().filterExpression(expression).build());
}
any help would be much appreciated, thanks!
EDIT: thought I'd provide more information, here's the exact Exception thrown in the AWS SDK, I don't have the expertise nor the required knowledge to trace this back properly but maybe someone would, https://github.com/aws/aws-sdk-java-v2/blob/master/core/sdk-core/src/main/java/software/amazon/awssdk/core/interceptor/ExecutionAttribute.java
Solution
Issue was fixed, still have no idea what the root cause of it was, however doing a clean pull of the repository and clearing all sorts of cache fixed the problem for me.
Answered By - Humid-IDE
Answer Checked By - Mary Flores (JavaFixing Volunteer)