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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How do I handle an exception

Hi,

 

I am facing below error in tfileinputexcel component :

Exception in component tFileInputExcel_1
java.lang.ArrayIndexOutOfBoundsException: 1120256

 

this is because I have a corrupted file in input , but I want my job to run with non-corrupted file and handle this exception. Could you please help.

Labels (3)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

The exception is thrown in child job, so you can use a tLogCatcher in the child job to capture the exception error and log them to a file or db.

View solution in original post

10 Replies
Anonymous
Not applicable
Author

Hello,

Can you open your corrupted file with MS Excel? Are you able to create 'File Excel' in metadata wizard?

Here is online document about:TalendHelpCenter:Centralizing File Excel metadata.

Best regards

Sabrina

Anonymous
Not applicable
Author

Hi, Thanks for the response.
No I cannot open the corrupted file with MS excel, It comes with a bunch of other files with same file mask and it is stopping to process the other input files available in the folder.
I want to catch an exception where it just populate a message saying that "corrupted file ignored" , so that I dont get a big red error message and non process of data at all.

Let me know if you need any more info or screenshot.
Anonymous
Not applicable
Author

Hello,

Are you trying to retrieve a set of files or folders based on  a filemask pattern and iterates on each unity?

What does your current job design look like?

Best regards

Sabrina

Anonymous
Not applicable
Author

Hi Sabrina,

 

Let me explain you more on this :

I am working on exception handling scenarios , where i have 5 input files in a folder, and one of them is corrupted and the job is throwing below error  :

Exception in component tFileInputExcel_1
java.lang.ArrayIndexOutOfBoundsException: 1120256
at jxl.read.biff.Record.<init>(Record.java:79)
at jxl.read.biff.File.next(File.java:181)
at jxl.read.biff.SheetImpl.<init>(SheetImpl.java:300)
at jxl.read.biff.WorkbookParser.parse(WorkbookParser.java:803)
at jxl.Workbook.getWorkbook(Workbook.java:271)
at test job

This is affecting the job while processing other non-corrupted files.

 

What I want to achieve is :

Catch the exception and process the job with non-corrupted files. 

The similar scenario can be as per below :

For example : I have total 5 input files , but one of them has a different sheet name. So It will throw "Special sheet does not exists error",

But I still want to process the job with the files which have correct sheet names in them.

 

I hope now Im able to explain better. Job flow is :

 

tfilelist---iterate--> iFileinputexcel---main-->tlogrow

 

I even tried with on component error trigger on tDie , but its not working somehow.

 

Could you please help in this. 

Thanks

 

Anonymous
Not applicable
Author

Hello,

Make sure you have cleared 'Die on error' option on tfileinputexcel component to skip the row on error and complete the process for error-free rows.

Best regards

Sabrina

 
Anonymous
Not applicable
Author

Hi,

I already did that and its still not working, I have attached screen shot now.
Regards,
Neha


Capturedie.PNG
Anonymous
Not applicable
Author

Can someone please help in this requirement. 

Anonymous
Not applicable
Author

Hi
You need to redesign the job as below:
main job:
tFileList--iterate--tRunjob

on tRunJob: pass the current file path to child job, see
https://community.talend.com/t5/Design-and-Development/Passing-a-value-from-a-parent-Job-to-a-child-...
and uncheck the 'die on error' option.

child job:
tfileinputXML--main--tlogrow

The main job will continue to iterate next file even though the child job has an error.

Regards
Shong
Anonymous
Not applicable
Author

Thank you for the response Shong.

Further to add in this, what if I want to catch this exception (Print a message in the log so I can know the exception)that one file is corrupted or Sheet does not exists.

and exit the job with code 1.

 

Any solution for that please. 

 

Best Regards,

Neha