Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
Could you kindly help me resolve the error: java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Map.
I am preparing Parent/child job where the parent job read and updates the restart table.
I went through the link: https://www.talendbyexample.com/talend-returning-values-from-subjobs.html
which shows how to return the last processed record details from child job to parent job.
Following the above link, this is what I have done:
Parent Jobflow:
tJava_2 -> tRunJob_1 -> tJava_3
Child JobFlow:
dbInput -> tJavaFlex_1
| (OnSubjobError)
|
tJava_2
1. Parent job:
a) tJava_2:
globalMap.put("sharedMap", new java.util.concurrent.ConcurrentHashMap());
b) tRunJob:
Parameters -> Values
sharedMap -> (java.util.Map)globalMap.get("sharedMap")
2. Child job:
a) Contexts:
Name -> Type -> Value
sharedMap -> Object ->
globalMap.get("sharedMap")
b) tJavaFlex_1
globalMap.put("last_id", row3.ID.toString());
c) tJava_2
((java.util.Map) context.sharedMap).put("last_id", globalMap.get("last_id").toString());
3. Parent job:
a) tJava_3:
System.out.println("last_id=" + ((String) ((java.util.Map) globalMap.get("sharedMap")).get("last_id")));
Thank you.
As suggested I am using file to pass between parent and child process running individually.
I am getting the error in 2. Child job: in tJava_2 component:
java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Map.
Help please!!!
As suggested I am using file to pass between parent and child process running individually.