Jackson-databind: How to convert JsonNode to ObjectNode

Created on 10 Dec 2018  路  1Comment  路  Source: FasterXML/jackson-databind

I want to partly modify some field value in a json file without entity class , so i have to use JsonNode to convert to ObjectNode.
but when i attempt to do this way, it throw a exception:Caused by: java.lang.ClassCastException: com.fasterxml.jackson.databind.node.TextNode cannot be cast to com.fasterxml.jackson.databind.node.ObjectNode

so how can i resolve this problem,or is there any other method to partly update json file without entity class

>All comments

Was this page helpful?
0 / 5 - 0 ratings