简体   繁体   中英

com.fasterxml.jackson.databind.deser.UnresolvedForwardReference with @JsonIdentityInfo

I have this an error

this because in mj json I have this element

"employe": 1,
        "statutControle": {
            "statutControleID": 1,
            "description": "vérification documents ok",
            "controles": [
                1234
            ]
        }

This should be employeID instead of employe

I have this for my entity and I am using @JsonIdentityInfo:

//bi-directional many-to-one association to Employe
    @ManyToOne
    @JoinColumn(name="employeID")
    private Employe employe;


    com.fasterxml.jackson.databind.deser.UnresolvedForwardReference:
Unresolved forward references for: Object id [1] (for class
com.controletec.siege.db.Employe) at [Source:
/Users/florakalisa/Desktop/workspace/json/ctrl.json; line: 259,
column: 21], Object id [1] (for class com.controletec.siege.db.Test)
at [Source: /Users/florakalisa/Desktop/workspace/json/ctrl.json; line:
268, column: 14], Object id [3] (for class
com.controletec.siege.db.Test) at [Source:
/Users/florakalisa/Desktop/workspace/json/ctrl.json; line: 269,
column: 14], Object id [5] (for class com.controletec.siege.db.Test)
at [Source: /Users/florakalisa/Desktop/workspace/json/ctrl.json; line:
270, column: 14], Object id [7] (for class
com.controletec.siege.db.Test) at [Source:
/Users/florakalisa/Desktop/workspace/json/ctrl.json; line: 271,
column: 14], Object id [9] (for class com.controletec.siege.db.Test)
at [Source: /Users/florakalisa/Desktop/workspace/json/ctrl.json; line:
272, column: 14].

Please add your complete Employe class show all the jackson annotations and the json string that you are trying to deserialize. This seems like a jackson bug whereby id's can't appear before their complete objects.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM