# First App - Post request - error in saving

**URL:** <https://forum.serverless.com/t/first-app-post-request-error-in-saving/11458>\
**Category:** Serverless Framework\
**Tags:** aws, lambda, iam, dynamodb\
**Created:** [May 15, 2020, 12:54pm UTC](https://forum.serverless.com/t/first-app-post-request-error-in-saving/11458 "2020-05-15T12:54:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![toriacht](https://avatars.discourse-cdn.com/v4/letter/t/ea666f/32.png) [@toriacht](https://forum.serverless.com/u/toriacht)\
**Post date:** [May 15, 2020, 12:54pm UTC](https://forum.serverless.com/t/first-app-post-request-error-in-saving/11458/1 "2020-05-15T12:54:15Z")

</div>

Hi

I just completed the [How to create a REST API in Java using DynamoDB and Serverless tutorial](https://www.serverless.com/blog/how-to-create-a-rest-api-in-java-using-dynamodb-and-serverless/).

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:
```

---

<div class="post-metadata">

**Author:** ![garethmcc](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/garethmcc/32/2276_2.png) [@garethmcc](https://forum.serverless.com/u/garethmcc)\
**Post date:** [May 15, 2020, 2:59pm UTC](https://forum.serverless.com/t/first-app-post-request-error-in-saving/11458/2 "2020-05-15T14:59:56Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![toriacht](https://avatars.discourse-cdn.com/v4/letter/t/ea666f/32.png) [@toriacht](https://forum.serverless.com/u/toriacht)\
**Post date:** [May 15, 2020, 3:13pm UTC](https://forum.serverless.com/t/first-app-post-request-error-in-saving/11458/3 "2020-05-15T15:13:12Z")

</div>

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

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/serverless/original/2X/0/0dcda925b6b71125229bb1df9b055feaf8aab035.png)

dependency:

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

---

<div class="post-metadata">

**Author:** ![bytekast](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/bytekast/32/4260_2.png) [@bytekast](https://forum.serverless.com/u/bytekast)\
**Post date:** [May 20, 2020, 2:27pm UTC](https://forum.serverless.com/t/first-app-post-request-error-in-saving/11458/4 "2020-05-20T14:27:52Z")

</div>

Are you explicitly logging the error message?

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