Implicit Context Load issues

One Star

Implicit Context Load issues

Hello *,
good day.
This issue has been discussed over and over, and I apologise to come up with it again. I have read (many) posts on this, but it seems my prob is a bit different.
As so many, I load the Context from a context file. The jobs have to run on a Unix/Linux system in the end, so I have separate directory pathes to the config file in Windows and in Unix.
On windows the path is defined in the "Contexts/Default" part of the registry. In Unix I have to pass the path via call parameter in a shell.
So I have defined the path to the file in the "project settings" as "context.PARAMS_FILE", and the actual value in the Contexts/Default/PARAMS_FILE variable.
This does work under windows OS, but not in an Unix environment. There I get:
-bash-3.00$ bash ./Masterjob_run.sh
C:/myproject/Datamigration/conf/migration.ctx (No such file or directory)
Warning: Parameter "TEST_DATA_DIR" has not been set by Implicit_Context_Context
Warning: Parameter "DISCARD_FILE_DIR" has not been set by Implicit_Context_Context
Warning: Parameter "LOG_FILE_DIR" has not been set by Implicit_Context_Context
Warning: Parameter "REJECT_FILE_DIR" has not been set by Implicit_Context_Context
Warning: Parameter "ERROR_FILE_DIR" has not been set by Implicit_Context_Context
Warning: Parameter "PARAMS_FILE" has not been set by Implicit_Context_Context
*** A0005_Display_Configuration ...
--------------------------------------------------
Runtime context parameters
--------------------------------------------------
PARAMS_FILE = C:/myproject/Datamigration/conf/migration.ctx
DISCARD_FILE_DIR = C:/myproject//Datamigration/logs/discard
ERROR_FILE_DIR = C:/myproject/Datamigration/logs/error
LOG_FILE_DIR = C:/myproject//Datamigration/logs
REJECT_FILE_DIR = C:/myproject/Datamigration/logs/reject
TEST_DATA_DIR = C:/myproject/Datamigration/data
--------------------------------------------------

As one might guess, "C:/myproject/Datamigration/conf/migration.ctx " is the Windows location of the config file. The output from "*** " on is generated by a tJava component doing a
System.out.println(""\nDISCARD_FILE_DIR = " + context.DISCARD_FILE_DIR");

(and so on) in the end.
The test shell script on Unix:
cd `dirname $0`
ROOT_PATH=`pwd`
java -Xms256M -Xmx1024M -cp classpath.jar: testproject.masterjob_0_1.Masterjob --context=Default "--context_param PARAMS_FILE=$HOME/conf/migration.ctx"
PARAMS_FILE=$HOME/conf/migration.ctx"

It is run from the directory where the shell script resides.
I am running the community version of Talend:
"Talend Open Studio for Data Integration"
Version: 5.1.2
Build id: r90681-20120913-0734

Help and suggestions would be greatly appreciated,
Thank you,
Steve
Seventeen Stars

Re: Implicit Context Load issues

hi
about something like multi env.
@see screenshoot
regards
laurent
One Star

Re: Implicit Context Load issues

@see screenshoot

Hi kzone,
thank you, good idea. I do not know how to activate that "unix" environment when running on unix yet, but I guess I can find out.
beside that, should a parameter like
--context_param PARAMS_FILE=$HOME/conf/migration.ctx

in the starting shell script not override the definitions in the job?
Thank you again,
Steve
Community Manager

Re: Implicit Context Load issues

Hi
As kzone suggested, define different contexts for different env. You can specify the context when executing the job script according to the environment you are. for example:
cd `dirname $0`
ROOT_PATH=`pwd`
java -Xms256M -Xmx1024M -cp classpath.jar: projectname.test_0_1.test --context=Linux "$@"
//here Linux is a context name.
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: Implicit Context Load issues

Post can be closed, thank you.