Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am encountering the following exception while passing HashMap as Object type parameter in tRunJob component.
First, I created a HashMap and populated into globalMap as follows in a tJava component:
Map<String, Object> dashboardMap = new HashMap<String, Object>();
globalMap.put("dashboardMap", dashboardMap);
Then I use that HashMap as a parameter to tRunJob as follows:
"Use Dynamic Job" OFF
"Use an independent process to run subjob" OFF
"Die on child error" ON
"Transmit whole context" ON
Context Param:
Parameters Values
dashboard_map ((java.util.Map)globalMap.get("dashboardMap"))
Exception seen:
java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Map
TOS DI version 7.2.1
Please help.
@sballa , problem with the data type of dashboard_map in subjob as string because of that it could not able to convert map to string.
If you observed, I am passing the dashboard_map as an Object type parameter to tRunJob. So, converting is back to Map in that job must not raise the ClassCastException. All I am trying to do here is pass a Map and use it in the child job.
In the child job, I do:
(java.util.Map)context.dashboard_map to get the map from the context and use it. And here is where the ClassCastException is reported.
Passing Object type Context parameters from parent to child in tRunJob component used to work perfectly fine in prior TOS DI versions. Can anyone please help explain what changed in TOS DI 7.2.1 and how it can be addressed?