Skip to content
Advertisement

Tag: amazon-dynamodb

‘Profile file contained no credentials for profile’ error when doing PutItem using AWS Java SDK

I’m trying to put an item into a DynamoDB table using the AWS SDK for Java. I am using the EnhancedPutItem.java example from the docs: When running locally I can put the item successfully, but when I run my application as a task on Fargate, it throws this error: software.amazon.awssdk.core.exception.SdkClientException: Profile file contained no credentials for profile ‘default’: ProfileFile(profilesAndSectionsMap=[]). Answer

DynamoDB Update Transaction Java

I’m trying to update my table in dynamo with an update transaction. I want to update a specific row if it is found. If it isn’t found I want to add a new row to the table. I found some sample Java code here: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/transaction-example.html From my understanding this code is updating the row IF the condition that the product

Mapping List to DynamoDB

I’m trying to map to DynamoDB list of dates in Java I have written my own converter but it works only for LocalDateTime but not for the List. Does anyone know how to do it correctly? Should I write separate converter that will return list of strings where each string will be converted from localdatetime? Answer I wrote converter like

Dynamodb get a single item based on sort key only

I am new to dynamodb and I need to process 5M records. Each record has an id and a status. I need to query for each record based on its status, process it, and finally update the status. I am using DynamoDbEnhancedClient but I could not find example on how to query based only on the range and not the

Query DynamoDb Global Secondary Index

i am trying out dynamodb locally and got the following table: I want to query it with Java like this: But it throws a Exception with “QUery Key Condition not supported”. I dont understand this, because in the docs, the “<” operator is described as regular operation. Can anybody help me Answer DDB Query() requires a key condition that includes

Converting POJO into map

I have a Java class having 10 attributes, I want to convert this into 3 maps(Breaking it into 5,3,2 fields resepectively). I did some research and found that Jackson’s ObjectMapper can be used by doing something like this: This will be creating a single map for all the attributes in my POJO. What I want is have this POJO converted

AWS JAVA dynamoDB enhanced client putItem class cast exception

When I used enhanced client to put but it throws class cast exception. It gives me error java.lang.ClassCastException: com.db.dynamo.Tableclass cannot be cast to com.db.dynamo.Tableclass Answer This worked for me SpringBoot – Java AWS SDK 2 DynamoDB Enhanced Client and devtools problem So basically the issue was with spring dev tools and its class loader(2 in number), so you can either

Advertisement