Note that there are some explanatory texts on larger screens.

plurals
  1. POJsonMappingException: Already had POJO for id
    text
    copied!<p>I have an error when trying to work with @JsonIdentityInfo jackson annotation. When I try to deserialize the object I get the folowing exception:</p> <blockquote> <p>Could not read JSON: Already had POJO for id (java.lang.Integer) [1] (through reference chain: eu.cobiz.web.domain.Site["operators"]->eu.yavix.web.domain.Account["image"]->eu.cobiz.web.domain.Image["@Image"]);nested exception is <strong>com.fasterxml.jackson.databind.JsonMappingException</strong>: <strong><em>Already had POJO for id</em></strong> (java.lang.Integer) [1] (through reference chain: eu.yavix.web.domain.Site["operators"]->eu.cobiz.web.domain.Account["image"]->eu.cobiz.web.domain.Image["@Image"])</p> </blockquote> <p>The JSON I am trying to deserialize looks like:</p> <pre><code>{ "@Site": 1, "siteId": 1, "name": "0", "address": { "@Address": 2, "addressId": 4, "number": "22" }, "operators": [ { "accountId": 1, "email": "user982701361@yavix.eu", "image": { "@Image": 1, "imageId": 1, "uri": "http://icons.iconarchive.com/icons/deleket/purple-monsters/128/Alien-awake-icon.png" } }, { "accountId": 2, "email": "user174967957@yavix.eu", "image": { "@Image": 2, "imageId": 2, "uri": "http://icons.iconarchive.com/icons/deleket/purple-monsters/128/Alien-awake-icon.png" } } ] } </code></pre> <p>My domain object is annotated with</p> <pre><code>@JsonIdentityInfo(generator = ObjectIdGenerators.IntSequenceGenerator.class, property = "@Image") </code></pre> <p>The problem arises on @Id annotation since if I remove the annotation the problem disappears (as i did for account) but on my understanding the new feature is usefull for cyclic dependencies wich is usefull for me in other scenarios. There shouldn't be a conflict between the 2 images since they are differente objects.</p> <p>Does anybody have an idea on how to solve or what is the problem?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload