One Star

Reg: Calling two context files in one job

I want to call two context files in one job. One of my context file consist of Database credentials and the other context file holds the name of a source file from which I should read the data for my job.
I am not able to call both the context file one job.
But as per my requirement values like database credentials and source file name is configurable. My source file name changes for each and every load.
How can I achieve this in Talend. Is there any viable solution for this issue? Please suggest me some method where I can do this.
I have also used tFileList. My tFileList points out to a folder where my context files are defined. Context values are defined as following
FILENAME;/usr/local/filename-2010-dt.log; -----> which is a delimited file
I have to pass these two files in my next job
I have used
tFileList -Iterate-> tfileInput -main-> tContextLoad -On Component ok->tFileInputdelimited-main->tMysqlOutput
I am able to fetch the value correctly till tContextLoad.
I have also define my context for the values in my context tab as specified in context file. I can't use both these files together. It's throwing an error

Please see the error message and also screenshots
connecting to socket on port 4200
tContextLoad_1 set key "FILENAME" with value "/usr/local/filename-2010-dt.log"
199 milliseconds
Exception in component tMysqlOutput_1
java.sql.SQLException: Must specify port after ':' in connection string
at com.mysql.jdbc.SQLError.createSQLException(
at com.mysql.jdbc.SQLError.createSQLException(
at com.mysql.jdbc.SQLError.createSQLException(
at com.mysql.jdbc.NonRegisteringDriver.parseHostPortPair(
at com.mysql.jdbc.Connection.createNewIO(
at com.mysql.jdbc.Connection.<init>(
at com.mysql.jdbc.JDBC4Connection.<init>(
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(
at java.lang.reflect.Constructor.newInstance(
at com.mysql.jdbc.Util.handleNewInstance(
at com.mysql.jdbc.Connection.getInstance(
at com.mysql.jdbc.NonRegisteringDriver.connect(
at java.sql.DriverManager.getConnection(
at java.sql.DriverManager.getConnection(
at amr4_etl.job_tfilelist_0_1.job_tFileList.tFileInputDelimited_2Process(
at amr4_etl.job_tfilelist_0_1.job_tFileList.tFileList_1Process(
at amr4_etl.job_tfilelist_0_1.job_tFileList.runJobInTOS(
at amr4_etl.job_tfilelist_0_1.job_tFileList.main(
Job job_tFileList ended at 12:20 20/05/2010.
Please let me know whether my approach as method is correct.


Re: Reg: Calling two context files in one job

Hi Naju
Can you try by changing the onComponentOk link with a OnSubjobOK one ?
One Star

Re: Reg: Calling two context files in one job

Hi Camsellem,
Thanks for the response. But there is no link as OnSubJob ok when you right click on tContextLoad component.

Re: Reg: Calling two context files in one job

Yes this is normal the link should be after tFileList (start point of your subjob).