Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi guys,
I was like 5 hours googling and searching that on forums (ask is the last option):
I have a context where I have a few variables and I want to fill them with a properties file when job runs.
I have got a "tFileInputDelimiter" joined to a "tContextLoad" with the "Print operations" checkbox checked for debug reasons. Where I run the job the execution console shows like the subjob worked and the variables filled, but, when I use anyone of them, it returns a null value.
I have got a tJava to show the value with:
System.out.println((globalMap.get("NUM_CONNS")));
I am a very newbie in this tool and that can be a newbie problem too, but I was a lot of hours searching for it.
I am using Talend 5.4.1 version.
Hope you can help me.
Thank you.
System.out.println(context.NUM_CONNS);
System.out.println(((String)globalMap.get("NUM_CONNS")));
System.out.println(((String)globalMap.get("NUM_CONNS")));
Starting job MAIN at 14:08 21/04/2016.
[statistics] connecting to socket on port 3871
[statistics] connected
tContextLoad_1 set key "NUM_CONNS" with value "2"
tContextLoad_1 set key "dbnameCONN1" with value "MDB"
tContextLoad_1 set key "dbnameCONN2" with value "MBD"
tContextLoad_1 set key "dbnameCONN3" with value ""
tContextLoad_1 set key "dbnameCONN4" with value ""
tContextLoad_1 set key "dbnameCONN5" with value ""
tContextLoad_1 set key "hostCONN1" with value "OK"
tContextLoad_1 set key "hostCONN2" with value "OK2"
tContextLoad_1 set key "hostCONN3" with value ""
tContextLoad_1 set key "hostCONN4" with value ""
tContextLoad_1 set key "hostCONN5" with value ""
tContextLoad_1 set key "passCONN1" with value "admin"
tContextLoad_1 set key "passCONN2" with value "admin"
tContextLoad_1 set key "passCONN3" with value ""
tContextLoad_1 set key "passCONN4" with value ""
tContextLoad_1 set key "passCONN5" with value ""
tContextLoad_1 set key "portCONN1" with value "1233"
tContextLoad_1 set key "portCONN2" with value "1233"
tContextLoad_1 set key "portCONN3" with value ""
tContextLoad_1 set key "portCONN4" with value ""
tContextLoad_1 set key "portCONN5" with value ""
tContextLoad_1 set key "schemaCONN1" with value "TEST1"
tContextLoad_1 set key "schemaCONN2" with value "TESTMASTER"
tContextLoad_1 set key "schemaCONN3" with value ""
tContextLoad_1 set key "schemaCONN4" with value ""
tContextLoad_1 set key "schemaCONN5" with value ""
tContextLoad_1 set key "userCONN1" with value "TEST01"
tContextLoad_1 set key "userCONN2" with value "TESTMASTER"
tContextLoad_1 set key "userCONN3" with value ""
tContextLoad_1 set key "userCONN4" with value ""
tContextLoad_1 set key "userCONN5" with value ""
null
[statistics] disconnected
Job MAIN ended at 14:08 21/04/2016. [exit code=0]
System.out.println(context.NUM_CONNS);
System.out.println((globalMap.get("NUM_CONNS")));System.out.println(context.NUM_CONNS);
Starting job MAIN at 16:53 21/04/2016.
[statistics] connecting to socket on port 3781
[statistics] connected
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
NUM_CONNS cannot be resolved or is not a field
at chh_stats_checker.main_0_1.MAIN.tJava_1Process(MAIN.java:1109)
at chh_stats_checker.main_0_1.MAIN.tFileInputDelimited_1Process(MAIN.java:1023)
at chh_stats_checker.main_0_1.MAIN.tChronometerStart_1Process(MAIN.java:550)
at chh_stats_checker.main_0_1.MAIN.tPrejob_1Process(MAIN.java:441)
at chh_stats_checker.main_0_1.MAIN.runJobInTOS(MAIN.java:1459)
at chh_stats_checker.main_0_1.MAIN.main(MAIN.java:1326)
tContextLoad_1 set key "NUM_CONNS" with value "2"
tContextLoad_1 set key "dbnameCONN1" with value "mbd"
tContextLoad_1 set key "dbnameCONN2" with value "mbd"
tContextLoad_1 set key "dbnameCONN3" with value ""
tContextLoad_1 set key "dbnameCONN4" with value ""
tContextLoad_1 set key "dbnameCONN5" with value ""
tContextLoad_1 set key "hostCONN1" with value "192.168.0.1"
tContextLoad_1 set key "hostCONN2" with value "192.168.0.1"
tContextLoad_1 set key "hostCONN3" with value ""
tContextLoad_1 set key "hostCONN4" with value ""
tContextLoad_1 set key "hostCONN5" with value ""
tContextLoad_1 set key "passCONN1" with value "1234"
tContextLoad_1 set key "passCONN2" with value "1234"
tContextLoad_1 set key "passCONN3" with value ""
tContextLoad_1 set key "passCONN4" with value ""
tContextLoad_1 set key "passCONN5" with value ""
tContextLoad_1 set key "portCONN1" with value "1521"
tContextLoad_1 set key "portCONN2" with value "1521"
tContextLoad_1 set key "portCONN3" with value ""
tContextLoad_1 set key "portCONN4" with value ""
tContextLoad_1 set key "portCONN5" with value ""
tContextLoad_1 set key "schemaCONN1" with value "CONN1"
tContextLoad_1 set key "schemaCONN2" with value "MASTER"
tContextLoad_1 set key "schemaCONN3" with value ""
tContextLoad_1 set key "schemaCONN4" with value ""
tContextLoad_1 set key "schemaCONN5" with value ""
tContextLoad_1 set key "userCONN1" with value "CONN1"
tContextLoad_1 set key "userCONN2" with value "MASTER"
tContextLoad_1 set key "userCONN3" with value ""
tContextLoad_1 set key "userCONN4" with value ""
tContextLoad_1 set key "userCONN5" with value ""
[statistics] disconnected
[statistics] disconnected
[statistics] disconnected
Job MAIN ended at 16:53 21/04/2016. [exit code=1]