Catching Exceptions thrown by Talend in java try catch.

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, 
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

Calling Talend Open Studio Users

The first 100 community members completing the Open Studio survey win a $10 gift voucher.

Start the survey

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.

Download