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

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

how to call external Java application in talend?

Hi all,
We implemented one logic with java code,this is located in eclipse.
I want to call external java code in Talend, then the java code is execute in eclipse.
how to call external java code in talend?
Thanks in Advance.
Regards,
kumar.talend
Labels (3)
4 Replies
Anonymous
Not applicable
Author

hi,
have a look at :
https://help.talend.com/search/all?query=Calling+a+Talend+Job+from+an+external+Java+application&cont...
PS : Don't forget to use search Talend forum option OR Talend help center ... there are a lot of great informations about Talend. 0683p000009MACn.png
regards
laurent
Anonymous
Not applicable
Author

Hi Kumar,
Please find below some steps that you can use to get a Talend based job called from within Eclipse.
You will want to use the 'Export Job' option on the job you want to call. This will create the jar files needed to call the java class. Once you have done that, unzip the file and copy the jar files in a folder that resides within an Eclipse project. We use a project to hold jar files from external sources which these are.
Once you have the jar files copied to your Eclipse workspace, add the jar files to the classpath (aka buildpath) of the project that holds the class that will be calling your Talend based job.
From here you just need to add a few lines of java code to call your job. See below sample code.
NOTE: The Sample_TalendJob reference listed below is the name of the job within Talend that you exported.
Also, the below example has a date value being passed in via the argument list.
String[] etlArgs = { "--context=custom", "--context_param processDate=" + processDate };
String returnCode[][];
Sample_TalendJob sampleTalendJob = new Sample_TalendJob();
returnCode = sampleTalendJob.runJob(etlArgs);
if (returnCode.equals("0")) {
// job ran without error
} else {
// job encountered error
}
Hope the above helps.
Tom
Anonymous
Not applicable
Author

Hi , I am already doing the same , but this might be the case that Talend is not throwing the exception in my scenario and is simply writing on to the console . and hence , the exception is not caught.
Thanks for the timely response.
Anonymous
Not applicable
Author

Hi yadavjyoti24,
Have you tried to use  tlogcatcher component in your job? Which can be used to capture exception and log them(console, file or db table ).
Best regards
Sabrina