Already had POJO for id error

2,391 views
Skip to first unread message

Claudio Miranda

unread,
Jan 21, 2015, 5:44:49 PM1/21/15
to jackso...@googlegroups.com
Hi folks, I saw some pages on the internet related to this error,

Already had POJO for id (java.lang.Integer) [com.fasterxml.jackson.annotation.ObjectIdGenerator$IdKey@b9fdebc0] (through reference chain: br.com.myapp.consulting.model.PartnerOrganization["@id"])

it says to add the JsonIdentityInfo annotation, which I did, but the error keep showing.
this is a POST to modify an existent object on the datamodel (JPA)

{"@id":1,"id":1,"name":"Company B","enabled":true,"persons":[],"registered":1421173467097}

The entity class

@Entity
@Table(name="partner_org")
@Audited
@JsonIgnoreProperties(ignoreUnknown=true)
@JsonIdentityInfo(generator=ObjectIdGenerators.IntSequenceGenerator.class, property="@id", scope=PartnerOrganization.class)
public class PartnerOrganization extends AbstractEntity {

Any suggestion ?

Thanks

Claudio

Claudio Miranda

unread,
Jan 21, 2015, 7:42:04 PM1/21/15
to jackso...@googlegroups.com

I use the jboss resteasy framework, it uses jackson 2.4.1

Tatu Saloranta

unread,
Jan 21, 2015, 8:09:37 PM1/21/15
to jackso...@googlegroups.com
Which Jackson version?

-+ Tatu +-


--
You received this message because you are subscribed to the Google Groups "jackson-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jackson-user...@googlegroups.com.
To post to this group, send email to jackso...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Claudio Miranda

unread,
Jan 21, 2015, 8:50:25 PM1/21/15
to jackso...@googlegroups.com


On Wednesday, January 21, 2015 at 11:09:37 PM UTC-2, Tatu Saloranta wrote:
Which Jackson version?

Tatu Saloranta

unread,
Jan 22, 2015, 2:49:33 AM1/22/15
to jackso...@googlegroups.com
Make sure to upgrade to 2.4.2 or later (2.4.5 is the latest, use that): there is one bug specifically related to problems with flushing of object id mappings:

https://github.com/FasterXML/jackson-databind/issues/499

Note that the other github issue you updated is probably not the same as your problem, since your document does not have duplicate ids.  So while error message is the same, underlying problem is probably different.

Upgrading to a later patch version is safe, so while ideally RESTeasy should upgrade version dependency, there should be no problems explicitly overriding version.

-+ Tatu +-


--

Claudio Miranda

unread,
Jan 22, 2015, 6:25:58 AM1/22/15
to jackso...@googlegroups.com
On Thursday, January 22, 2015 at 5:49:33 AM UTC-2, Tatu Saloranta wrote:
Make sure to upgrade to 2.4.2 or later (2.4.5 is the latest, use that): there is one bug specifically related to problems with flushing of object id mappings:

https://github.com/FasterXML/jackson-databind/issues/499


Ah, IT WORKS. Thank you so much. Very happy here.
I upgraded to jackson 2.4.2 and recommed to resteasy guys to upgrade their version too.

--
Claudio

Tatu Saloranta

unread,
Jan 22, 2015, 2:33:57 PM1/22/15
to jackso...@googlegroups.com
Good! I strongly recommend using 2.4.5, as there are a few other fixes. But this is probably the nastiest problem that has been fixed since 2.4.1.

-+ Tatu +-


--
Reply all
Reply to author
Forward
0 new messages