It was a dirty exception I faced few weeks back. I was trying to to consume a REST API call using postForEntity.
Unfortunately my ID variable was in primitive long instead of Long. I hit with the following error. I had been roaming around without a clue.
org.springframework.http.converter.HttpMessageNotWritableException: Could not write JSON: (was java.lang.NullPointerException)
Ref: https://stackoverflow.com/questions/24805043/org-springframework-http-converter-httpmessagenotwritableexception-could-not-wr
