This repository has been archived by the owner on Dec 13, 2023. It is now read-only.
Reading JSON from workflow input throws "ClassCastException" exception #3538
Unanswered
KunalKumar050894
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I'm passing a json as input to the workflow and need to pass the json as it is to my worker.
My input json:
{
"v3Spec":{
"version": "1",
"sddc_id": "1a3bd15e-97be-472c-ba7e-3f2f6f6e19d4",
}
}
Code for fetching it inside worker:
String spec = (String)task.getInputData().get("v3Spec");
While accessing the json inside my worker I'm getting following error:
java.lang.ClassCastException: class com.google.gson.internal.LinkedTreeMap cannot be cast to class java.lang.String (com.google.gson.internal.LinkedTreeMap is in unnamed module of loader 'app'; java.lang.String is in module java.base of loader 'bootstrap')
I've also tried casting input to JSONObject that didnt worked.
Please help with providing a resolution.
Beta Was this translation helpful? Give feedback.
All reactions