Talend Job export and execution problem.

One Star

Talend Job export and execution problem.

Hi All
I am using Talend Big Data 6.2 Studio tool and exporting job as BuildJob->Build Type: OSGI Bundle for ESB. Now when I am using java code to call this jar file, it is showing the below error.
Exception in thread "main" java.lang.NoClassDefFoundError: routines/system/api/TalendJob
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at TestClassTalendJar.main(TestClassTalendJar.java:5)
Caused by: java.lang.ClassNotFoundException: routines.system.api.TalendJob
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 13 more

Please suggest me the way. We are running behind of time and not able to progress a single steps ahead.
Prakash
Moderator

Re: Talend Job export and execution problem.

Hi,
There is missing jar issue. Did you export your job completely? Are you using talend subscription bigdata 6.2? Can you successfully execute your job in studio without any exception?
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.
One Star

Re: Talend Job export and execution problem.

Hi Sabrina
Thanks a lot for your response.
Yes, I just use below steps for exporting the jars from Talend Open Studio for Big Data tool. Please find the attached screen shot mentioning the version of the Tool. It is showing 6.2.0 there.
The steps, I am following for getting the jar file is as below
1) Design the job from Talend Open studio for Big Data tool.
2) Execute the job from the IDE successfully.
3) Build job as below
   Right Click on the Job->click on Build Job->Select the Build Type as "OSGI Bundle for ESB" -> Mention the Jar file path in "To archive location"->Click "Finish"
4) After exporting the jar, I am using java code to load that jar and execute the job. But it is showing above error there.
Please suggest me the jar name which is missing in above.
Regards,
Prakash
Moderator

Re: Talend Job export and execution problem.

Hi,
Have you tried to deploy your .jar file(OSGI Bundle for ESB) in Talend ESB runtime to see if it works well?
What's the java code you are using to call this .jar 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.
One Star

Re: Talend Job export and execution problem.

Hi Sabrina
Please help me to know the path of downloading OSGI Bundle for ESB jar. 
N.B: We just used the Talend IDE for building the jar and used that jar for executing the job from the java program as below.
Our sample java code is below:
import talendruntimejobpkg.calljobineclipsedemo_0_1.CallJobFromEclipse;
public class SampleExample {
    public static void main(String[] args) {       
        CallJobFromEclipse tJob = new CallJobFromEclipse ();
        int inputfile= "hdfs://hadoop/ddd/abcd11.csv";
        String outputfile = "hdfs://hadoop/ddd/a/output.csv"
        String [] context=new String[] {"--context_param inputfile="+inputfile= ,"--context_param outputfile="+outputfile};
        tJob.runJob(context);
    }
}
This is a simple Talend job for picking a csv file from one hdfs folder and pasting to another folder. 
Please help me to know the issues. Let me know if you need more details about the job.
Moderator

Re: Talend Job export and execution problem.

Hi,
Did you follow up document about:TalendHelpCenter:How to build Jobs?
Usually, we  build a job as an OSGI Bundle in order to deploy our Job in Talend ESB Container.
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.