-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MismatchedInputException: Cannot deserialize instance of com.fasterxml.jackson.databind.node.ObjectNode
out of VALUE_NULL token
#3056
Comments
Thank you for reporting this; I agree that it sounds like a flaw in implementation. |
Thankyou for looking at this issue. Unfortunately I know very little about Jackson internals, but my first thought is this code here https://github.com/FasterXML/jackson-databind/blob/2.12/src/main/java/com/fasterxml/jackson/databind/deser/std/JsonNodeDeserializer.java#L391 if (old instanceof ObjectNode) {
JsonNode newValue = updateObject(p, ctxt, (ObjectNode) old);
if (newValue != old) {
node.set(key, newValue);
}
continue;
} If we could change it to something like... I've tried this in a debugger by skipping the test on line 391 and it outputs expected results, but because of the TokenParser I'm not sure how to check that the new 'thing' would be an instance of |
Thanks; I should be able to figure out. It may be just question of parent (enclosing) |
Same problem also happened to Fixed in 2.12 for 2.12.1; slightly concerned about XML use case (since 2.12 had big improvements to |
@cowtowncoder Many thanks for resolving, i was looking at adding test cases to NodeMergeTest but the in the copy I've cloned the ObjectWriter here https://github.com/FasterXML/jackson-databind/blob/master/src/main/java/com/fasterxml/jackson/databind/ObjectWriter.java#L177 requires this file https://github.com/FasterXML/jackson-databind/blob/master/src/main/java/com/fasterxml/jackson/databind/cfg/PackageVersion.java.in but cannot due to the .in suffix on the filename. What purpose does the .in suffix serve? Should I just rename it to make it compile? |
Sorry please ignore that I've just seen the comments in the file I added.
Doh!. |
Unfortunately I have been unable to make it so that IDE auto-import would auto-generate that file: running |
When using readerForUpdating and updating an existing objectNode to a null Node this exception is triggered
Version information
Jackson : 2.11.4
Java : openjdk-15.0.2
To Reproduce
Expected behavior
In the code above
node
starts as{ "test": {} }
and updated with the object
update
containingafter the update is applied
afterUpdateNode
should contain the followingBut instead the above exception is raised. This looks to be same as #2325 but that was closed by the originator
The text was updated successfully, but these errors were encountered: