Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

tRunJob: Unable to pass Object parameter from parent to child job

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.

 

 

Labels (2)
3 Replies
manodwhb
Champion II
Champion II

@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.

Anonymous
Not applicable
Author

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.

Anonymous
Not applicable
Author

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?