{"record":{"id":"0a4d5983db0def5a","repo":"FasterXML/jackson-databind","slug":"cannot-handle-managed-back-reference-type-v","errorCode":null,"errorMessage":"Cannot handle managed/back reference '{}': type: value deserializer of type {} does not support them","messagePattern":"Cannot handle managed/back reference '(.+?)': type: value deserializer of type (.+?) does not support them","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/main/java/tools/jackson/databind/ValueDeserializer.java","lineNumber":456,"sourceCode":"     * Default implementation returns null, as support cannot be implemented\n     * generically. Some standard deserializers (most notably\n     * {@link tools.jackson.databind.deser.bean.BeanDeserializer})\n     * do implement this feature, and may return reader instance, depending on exact\n     * configuration of instance (which is based on type, and referring property).\n     *\n     * @return ObjectIdReader used for resolving possible Object Identifier\n     *    value, instead of full value serialization, if deserializer can do that;\n     *    null if no Object Id is expected.\n     */\n    public ObjectIdReader getObjectIdReader(DeserializationContext ctxt) { return null; }\n\n    /**\n     * Method needed by {@link BeanDeserializerFactory} to properly link\n     * managed- and back-reference pairs.\n     */\n    public SettableBeanProperty findBackReference(String refName)\n    {\n        throw new IllegalArgumentException(\"Cannot handle managed/back reference '\"+refName\n                +\"': type: value deserializer of type \"+getClass().getName()+\" does not support them\");\n    }\n\n    /**\n     * Introspection method that may be called to see whether deserializer supports\n     * update of an existing value (aka \"merging\") or not. Return value should either\n     * be {@link Boolean#FALSE} if update is not supported at all (immutable values);\n     * {@link Boolean#TRUE} if update should usually work (regular POJOs, for example),\n     * or <code>null</code> if this is either not known, or may sometimes work.\n     *<p>\n     * Information gathered is typically used to either prevent merging update for\n     * property (either by skipping, if based on global defaults; or by exception during\n     * deserializer construction if explicit attempt made) if {@link Boolean#FALSE}\n     * returned, or inclusion if {@link Boolean#TRUE} is specified. If \"unknown\" case\n     * (<code>null</code> returned) behavior is to exclude property if global defaults\n     * used; or to allow if explicit per-type or property merging is defined.\n     *<p>\n     * Default implementation returns <code>null</code> to allow explicit per-type","sourceCodeStart":438,"sourceCodeEnd":474,"githubUrl":"https://github.com/FasterXML/jackson-databind/blob/87876ca5c0569b4933aec2d30d6225e4b9ba3a43/src/main/java/tools/jackson/databind/ValueDeserializer.java#L438-L474","documentation":"Thrown by ValueDeserializer.findBackReference() (the default base implementation) when the deserializer does not support managed/back references (@JsonManagedReference / @JsonBackReference) but is asked to resolve one. Only specific deserializers (notably BeanDeserializer) override findBackReference() to actually link reference pairs; the default implementation always throws to signal lack of support.","triggerScenarios":"Annotating a field with @JsonBackReference on a type whose deserializer is not a BeanDeserializer (e.g., a custom ValueDeserializer, a Map deserializer, or a primitive/scalar deserializer). The BeanDeserializerFactory tries to wire the back-reference during deserializer construction and calls findBackReference() on the value deserializer for the referenced property.","commonSituations":"Using @JsonBackReference on a field whose type is a collection, map, or scalar. Applying JPA-style bidirectional reference annotations on non-bean types. Custom deserializers that don't implement reference handling.","solutions":["Ensure @JsonBackReference / @JsonManagedReference are only used on fields whose type is deserialized by a BeanDeserializer (standard POJOs).","If you have a custom ValueDeserializer that needs to support references, override findBackReference() in it.","Remove the managed/back reference annotations from fields whose types are not POJOs and handle the relationship manually (e.g., with @JsonIdentityInfo instead)."],"exampleFix":"// before\npublic class Parent {\n    @JsonManagedReference\n    public List<String> items; // List deserializer does not support back-references\n}\npublic class Child {\n    @JsonBackReference\n    public Parent parent;\n}\n// after: use @JsonIdentityInfo for non-bean bidirectional refs\n@JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class, property = \"id\")\npublic class Parent {\n    public List<String> items;\n}","handlingStrategy":"type-guard","validationCode":"// Before applying @JsonBackReference, verify the target type is a POJO\nif (!isBeanType(fieldType)) {\n    // do not use @JsonBackReference; use @JsonIdentityInfo instead\n}","typeGuard":"boolean supportsBackReferences(ValueDeserializer<?> deser) {\n    try {\n        deser.findBackReference(\"__test__\");\n        return true; // should not reach here for default impl\n    } catch (IllegalArgumentException e) {\n        return false;\n    }\n}","tryCatchPattern":null,"preventionTips":["Only use @JsonManagedReference/@JsonBackReference on POJO (bean) fields.","Use @JsonIdentityInfo for bidirectional references involving collections, maps, or scalars.","Test parent-child deserialization for every annotated reference pair."],"tags":["managed-reference","back-reference","deserializer","json-annotation","pojo"],"backgroundTag":null,"analyzedSha":"87876ca5c0569b4933aec2d30d6225e4b9ba3a43","analyzedAt":"2026-08-11T12:55:24.033Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}