Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi:
I have built a job in which I am using t_LogCatcher and tJavaRow to catch the error and send an email with some details and the following two values that I am getting in tJavaRow.
globalMap.put("error_origin",input_row.origin);
globalMap.put("error_msg",input_row.message);
I have got the following error (as Italics) after job execution and it is not clearly telling me what the error is. I want to get some suggestion as to what is the right way to catch the error in the exact component and with some more details about the error.
Error in component: tParallelize_1
Error message: java.lang.Exception:At least one of the subjobs in tParallelize fails
Any help will be greatly appreciated.
Thanks.
I suspect that you are getting more error messages than you are seeing, however the way you are collecting the errors, you are only receiving the last ones to arrive.
Try changing your tJavaRow code to something like this....
globalMap.put("error_origin",input_row.origin); globalMap.put("error_msg",input_row.message); if(globalMap.get("message")==null){ globalMap.put("message", input_row.origin+": "+input_row.message+";"); }else{ String previousMessage = ((String)globalMap.get("message")); previousMessage = previousMessage+input_row.origin+": "+input_row.message+";"; globalMap.put("message", previousMessage); }
Then add the globalMap "message" value to your email. You should see a difference.
Hi:
globalMap.get("message") is getting NULL value in the error condition also and the first if is getting executed and I am not getting any extra message. Am I missing something.
I put this code in the tJavaRow and I see the first condition getting executed in an error condition:
globalMap.put("error_origin",input_row.origin);
globalMap.put("error_msg",input_row.message);
if(globalMap.get("message")==null){
globalMap.put("message", input_row.origin+": "+input_row.message+";");
System.out.println("*****message::"+ globalMap.get("message"));
}else{
String previousMessage = ((String)globalMap.get("message"));
System.out.println("*****previousMessage::"+ previousMessage);
previousMessage = previousMessage+"!!!!!AND......"+ input_row.origin+": "+input_row.message+";";
globalMap.put("message", previousMessage);
System.out.println("*****ele message::"+ globalMap.get("message"));
}
I've tested this code. It definitely works. Just copy and paste it into your tJavaRow then use ((String)globalMap.get("message")) in your email body....
if(globalMap.get("message")==null){ globalMap.put("message", input_row.origin+": "+input_row.message+";"); }else{ String previousMessage = ((String)globalMap.get("message")); previousMessage = previousMessage+"\n"+ input_row.origin+": "+input_row.message+";"; globalMap.put("message", previousMessage); } System.out.println(((String)globalMap.get("message")));