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

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
java.io.FileNotFoundException: nullnull (No such file or directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at java.io.FileInputStream.<init>(FileInputStream.java:66)
at org.talend.fileprocess.TOSDelimitedReader.<init>(TOSDelimitedReader.java:76)
at org.talend.fileprocess.FileInputDelimited.<init>(FileInputDelimited.java:83)
at sample.wba_country_master_tran_0_1.WBA_COUNTRY_MASTER_TRAN.tFileInputDelimited_1Process(WBA_COUNTRY_MASTER_TRAN.java:516)
at sample.wba_country_master_tran_0_1.WBA_COUNTRY_MASTER_TRAN.runJobInTOS(WBA_COUNTRY_MASTER_TRAN.java:833)
at sample.wba_country_master_tran_0_1.WBA_COUNTRY_MASTER_TRAN.main(WBA_COUNTRY_MASTER_TRAN.java:743)

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
Selva.
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.
Bye
Volker