[resolved] Run talend transformation as the standalone (java) program

One Star

[resolved] Run talend transformation as the standalone (java) program

Hi,
i've just developed a simple tmap transformation, which takes input from a local mysql database, transforms it a bit, and then outputs it to remote mysql database. Work inside TOS runs well and does it's job.
The question is - is it possible with TOS edition to write a cron job, which would run this job daily?
The "Command-line" option in the talend features' matrix is not checked, only the webservice option.
So the question probably should be if the exported java code is fully capable of running all by itself, without any other talend server/TOS running at the same time?
If it is, maybe there is a "hello-world" tutorial lyins somewhere around (am asking this after 2 hours of googling, pl don't be strictSmiley Happy
Cheers,
all the best,
james

Accepted Solutions
Employee

Re: [resolved] Run talend transformation as the standalone (java) program

Hello,

First, you can download the User Guide : TOS_Studio_UG and read the 6.5 section, Exporting Job Scripts.
To deploy a talend job stand alone : In repository Right click on job, Select Export job Script to generate a zip file.
Zip file contains jar and .sh.
Unzip the package and launch the .sh file ( or .bat file )
to run daily the job, cron the .sh file in your crontab

All Replies
Employee

Re: [resolved] Run talend transformation as the standalone (java) program

Hello,

First, you can download the User Guide : TOS_Studio_UG and read the 6.5 section, Exporting Job Scripts.
To deploy a talend job stand alone : In repository Right click on job, Select Export job Script to generate a zip file.
Zip file contains jar and .sh.
Unzip the package and launch the .sh file ( or .bat file )
to run daily the job, cron the .sh file in your crontab
One Star

Re: [resolved] Run talend transformation as the standalone (java) program

Hi Emenuet,
thanks for a quick reply!
the printed version of TOS User guide is on my table for quite a while already, just somehow it was the wrong place i've been looking for this solution Smiley Happy
Worked as a charm,
Thanks a lot,
i love Talend! Smiley Happy
One Star

Re: [resolved] Run talend transformation as the standalone (java) program

Hi all,
i want to run a job using command line, i exported the script in the folder name ETL_exports,
i extracted the twoinput_0.1.zip file, and copied the twoinput_0.1 in ETL_export dir.
towinput_0.1 is my job name which i want to run using command line.

it show the following error.
C:\ETL_exports\twoinput_0.1\twoinput>java -Xms256M -Xmx1024M -cp classpath.jar;
sep30.twoinput_0_1.twoinput --context=Default
Exception in thread "main" java.lang.NoClassDefFoundError: sep30/twoinput_0_1/tw
oinput
Caused by: java.lang.ClassNotFoundException: sep30.twoinput_0_1.twoinput
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)

the job exported from talend does not create a .class file, it creates a .java file of the job name.
can any body let me know how to run a job exported by talend using command line