One Star

How to catch an exception and continue the treatment

Hello,
I have a query which sometimes returns a java.lang.NullPointerException.
I would like to know the way to catch a java.lang.NullPointerException from a tOracleInput and continue my process normally.
Best regards,
Shamza.
3 REPLIES
Community Manager

Re: How to catch an exception and continue the treatment

Hello
Put the tOracleInput in a child job, use a tRunJob to run the child job in a father job.
On tRunJob, uncheck the 'Die on child error' option.
If you want to pass records from child job to father job, you need a tBufferOutput in child job. eg:
tOracleInput-->tBufferOutput.
Best regards

shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: How to catch an exception and continue the treatment

Hi
I have similar issue as shamza, but shong's solution doesn't work for me.
I use tFTPPut component to upload files to the customer. Implementing failover solution, in case that the ftp server is unavailable, failed for me every time.
Now I use tRunJob to invoke tFTPPut as a child job and I've unchecked "die on error" option. My failover solution is use of tSendMail as an alternative for sending files to the customer, and i trigger this component by "On subjob error" connection from mentioned tRunJob component. However, every time I shut the ftp server down, exception is being raised and program terminates.
Can I provide you with additional info that will enable you to track my problem and solve it?
Here are the pictures of these two jobs, in case that my bad english is not clear enough Smiley Happy.
Community Manager

Re: How to catch an exception and continue the treatment

Hello guy
Change 'OnsubJobError' to 'OnsubJobOk', if you unchecked "die on error" option, means tRunJob always works well.
Best regards

shong
----------------------------------------------------------
Talend | Data Agility for Modern Business