Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
BN1
Contributor
Contributor

How to get the details of the Error in Talend Jobs

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.

Labels (3)
6 Replies
TRF
Creator III
Creator III

Share your job design
BN1
Contributor
Contributor
Author

Attaching the job screenshot


Screenshot_of_Job_LeadLoad.png
BN1
Contributor
Contributor
Author

Anonymous
Not applicable

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.

BN1
Contributor
Contributor
Author

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"));
}

 

Anonymous
Not applicable

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")));