eclipse-ee4j / eclipse-ee4j/yasson
don't let unresolved proxies cancel json-processing
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 218
- Forks
- 109
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 9
Description
I get this error when converting object to json-string with json-b:
javax.json.bind.JsonbException: Internal error: failed to lazily initialize a collection of role: test.Task.logs, could not initialize proxy - no Session
Task is a JPA Entity having logs-property as a lazy defined relationship, thus it's a proxy. I dont bother to include logs-property within json string.
Json-B should treat unresolvable proxies as null values by default instead of not generating a json-string and rethrowing exception.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce JSON-B conversion of a JPA Task with a lazy logs relationship after its session is closed, then trace how Yasson handles the unresolved proxy. Done means serialization completes and represents the unresolvable logs value as null instead of rethrowing the JsonbException.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend-api-design
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100