spring-projects / spring-projects/spring-hateoas

HttpMessageNotWritableException occurs when a field on an object has a @DBRef annotation

Open
#676 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

process: waiting for feedback
Dominant language
Java
Stars
1.1k
Forks
476
PR merge metrics
No merged PRs in 30d

Description

Failed to write HTTP message: org.springframework.http.converter.HttpMessageNotWritableException: Could not write JSON: (was java.lang.NullPointerException); nested exception is com.fasterxml.jackson.databind.JsonMappingException: (was java.lang.NullPointerException) (through reference chain: org.springframework.hateoas.Resource["content"])

I have attached a zip file with an example webservice, including a README with steps to reproduce this issue.

exampleWebservice.zip

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Unpack exampleWebservice.zip and read its README first, then follow the reproduction steps for the HttpMessageNotWritableException involving @DBRef and Resource["content"]. Done means the example no longer fails while writing the HTTP response, with the reproduced behavior checked against the original stack trace.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.