Throwing Classcast exception

28 views
Skip to first unread message

Aimaen Akief

unread,
Sep 26, 2019, 3:20:07 PM9/26/19
to jackson-user
I am trying to use redaction for my PII information before I save it in the server but when i initiated the code. It throws me this exception :

   ## java.lang.ClassCastException: com.fasterxml.jackson.databind.node.TextNode cannot be cast to com.fasterxml.jackson.databind.node.ObjectNode

Tatu Saloranta

unread,
Sep 26, 2019, 8:01:26 PM9/26/19
to jackson-user
On Thu, Sep 26, 2019 at 12:20 PM Aimaen Akief <ayma...@gmail.com> wrote:
>
> I am trying to use redaction for my PII information before I save it in the server but when i initiated the code. It throws me this exception :
>
> ## java.lang.ClassCastException: com.fasterxml.jackson.databind.node.TextNode cannot be cast to com.fasterxml.jackson.databind.node.ObjectNode

Yes. Do not try to case `TextNode` as `ObjectNode`: `TextNode` is not
a subtype of `ObjectNode`.

For more help, please include code and input you are using,

-+ Tatu +-
Reply all
Reply to author
Forward
0 new messages