One Star

Run the Talend job(Shell script)with context from another Shell Script

Hi Guys,
I have created a Job from Talend and exported the job as a Shell Script. I am am trying to run the Script from another parent shell script, I have given the paths for the jars and library files that were reqiured by the talend job. The Job uses context which is set in a property file. when i run the job from the main sh file it throwing the error like
Exception in component tFileInputDelimited_1 nullnull (No such file or directory)
at Method)
at org.talend.fileprocess.TOSDelimitedReader.<init>(
at org.talend.fileprocess.FileInputDelimited.<init>(
at sample.wba_country_master_tran_0_1.WBA_COUNTRY_MASTER_TRAN.tFileInputDelimited_1Process(
at sample.wba_country_master_tran_0_1.WBA_COUNTRY_MASTER_TRAN.runJobInTOS(
at sample.wba_country_master_tran_0_1.WBA_COUNTRY_MASTER_TRAN.main(

the error clearly states that it couldnt get the context properties from the property file(the context is for giving the input for a delimited input file dynamically) which means that it couldnt access the property file of the job Please make clear where to specify the path for the context property file, should i need to change the path in the underlying Java code or is there any way it can be mentioned in the Talend job sh file itself
I am pasting the contents of the sh file
java -Xms256M -Xmx1024M -cp ${JOB_SCRIPTS_DIR}/lib/javacsv.jar:${JOB_SCRIPTS_DIR}/lib/ojdbc5.jar:${JOB_SCRIPTS_DIR}/lib/talend_file_enhanced_20070724.jar:${JOB_SCRIPTS_DIR}/lib/systemRoutines.jar:${JOB_SCRIPTS_DIR}/lib/userRoutines.jar::.:${JOB_SCRIPTS_DIR}/WBA_COUNTRY_MASTER_TRAN/wba_country_master_tran_0_1.jar:${JOB_SCRIPTS_DIR}/lib: sample.wba_country_master_tran_0_1.WBA_COUNTRY_MASTER_TRAN --context=Default
Please reply ASAP....
Thanks in Anticipation
One Star

Re: Run the Talend job(Shell script)with context from another Shell Script

Hi Selva,
you should set the runtime directory to ${JOB_SCRIPTS_DIR}. For example ad a cd ${JOB_SCRIPTS_DIR} in your sh. This should help the ClassLoader to find the property files.