First App - Post request - error in saving

Hi

I just completed the How to create a REST API in Java using DynamoDB and Serverless tutorial.

I associated my aws account to serverless client via commandline
serverless config credentials --provider aws --key KEYKEYKEY2001--secret SECRETSECRET100001

All lambda functions are created, dynamoDB table, s3 bucket all created etc. I have fully ported in all code from the github example. The only change is the aws region from US to EU.

However, when I try and POST to create a demo product it fails to save. It connects correctly but fails to write to the DB

curl -vvv -X POST https://xxxxxxxxxxx.execute-api.eu-west-1.amazonaws.com/dev/products -d '{"name": "Product1", "price": 9.99}'

Note: Unnecessary use of -X or --request, POST is already inferred.
*   Trying 143.x.x.x...
* TCP_NODELAY set
* Connected to xxxxx.execute-api.eu-west-1.amazonaws.com (143.x.x.x) port 443 (#0)


"message": "Error in saving product:

It looks like there is a message from your Lambda. You should be able to see potentially more error detail in CloudWatch as that is where error messages go by default.

Hi @garethmcc

Thanks for the reply. Not much luck there. I can request coming in but it complains about no log4j appender despite it being in my dependencies

dependency:

<dependency>
  <groupId>com.amazonaws</groupId>
  <artifactId>aws-lambda-java-log4j2</artifactId>
  <version>1.1.0</version>
</dependency>

Are you explicitly logging the error message?

Regarding the log4j warning, do you have a log4j config file included in the deployment package?