Two Stars

Catching Exceptions thrown by Talend in java try catch.

HI , I have a talend Job. I am calling this Talend Job from some custom java classes in my web project .
I want to catch exceptions thrown by talend to be catched in my java classes. So that I can sense the Success / Failure of my Talend Job inside the java class.
Any kind of help is appreciated.
Thanks, 
4 REPLIES
Moderator

Re: Catching Exceptions thrown by Talend in java try catch.

Hi,
If you want to capture the exception and handle error. here is a component called tLogCatcher can be used to capture exception and log them(console, file or db table )
Or you can enter personalized code in TalendHelpCenter:tJavaFlex to catch exception in work flow.
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Four Stars

Re: Catching Exceptions thrown by Talend in java try catch.

Hi,
I have created a dummy job and build it. It will give me a zip file. Now I need to extract the zip. I will get a few jar files. Now In my web application, there will be a java call which will call the Talend job. Then I can create a Logger to log the exception in the log file.

In this screenshot, I have called a talend job. nb_line context variable in my job is of integer type. I am passing a dirty data as input. So, job will fail. I have captured the exception in the catch block.
If we want, we can capture the exception in a log file as well. 
Thanks,
Alok
Moderator

Re: Catching Exceptions thrown by Talend in java try catch.

Hi,
Do you want to save run console output in a log file? I mean do you want to output the full stack trace to a file?
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Four Stars

Re: Catching Exceptions thrown by Talend in java try catch.

Hi,
To check success or failure of the job , we can use talendJob.getStatus() method in the screenshot. This will give status of the job execution. This value is Success/failure. Then we have no need to focus on log file.
Thanks,
Alok