Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kinesis Stream PutRecord Failing : Unable to marshall request to JSON

I am writing transactions into Kinesis Stream(using AWS SDK, JAVA), but the putRecord is failing with the reason of "Marshalling error". I tried to send a simple string(instead of my complex object), but still getting the same error. Below is the stacktrace snippet.

AWS SDK version: 1.11.76

com.amazonaws.SdkClientException: Unable to marshall request to JSON: com.fasterxml.jackson.dataformat.cbor.CBORGenerator.getOutputContext()Lcom/fasterxml/jackson/core/json/JsonWriteContext;
at com.amazonaws.services.kinesis.model.transform.PutRecordRequestMarshaller.marshall(PutRecordRequestMarshaller.java:85)
at com.amazonaws.services.kinesis.AmazonKinesisClient.putRecord(AmazonKinesisClient.java:1365)
like image 618
meeza Avatar asked Jan 04 '23 17:01

meeza


1 Answers

Resolved by removing Jackson Dependency from my package. Reason: Conflict between my dependency import on Jackson vs AWS SDK's dependency on Jackson. Kinesis Client uses Jackson for marshalling. I was using Jackson's latest version, which was causing dependency conflict.

like image 69
meeza Avatar answered Jan 28 '23 20:01

meeza