You are not logged in.
Announcement
Unanswered posts
|
Pages: 1
Hi all,
I have developped some jobs. One master calling some others jobs.
The master job is like this :
tPrejob -------------> tFileInputPropertiesFile ------------> tContextLoad
tRunJob_1 --------->OnSubJobOK ---------> tRunJob_2 ...
All is good when I run the master job directly from talend to test my work but when I export the jobs to jar, the following error appears on the console :
"Could not find the context Default."
I transmit all the context to the tRunJob_xx.
This occurs in TOS 4.0.1 and TOS 4.0.2

I think, It's not an error. Just a warning message. Program will be fine even you get that message.
Look at the below steps to use the ContextLoad with FileInputDelimited component.
Here is what you can do...
1.Create a Properties File which will have all the Properties that you need to do a Db Connection like host, port, database, schema .. etc...
2.Have all the properties defined in the Contexts Tab. ( Contexts Tab is in betn Job and Component tab )
3.To read the Properties file you need to have a JVM Argument variable which will set the root path from where you will read all the properties or input file that you want
You can set the JVM argument under the Run Tab --> JVM Arguments
4. Use the tFileInputProperties to read the properties file and tContextLoad component to load the properties into the context.
5. to read the input properties using the tFileInputProperties component , either you can hardcode the input file path or you can read the file dynamically by writing the routine.
6. once you have the tFileInputProperties component set map it to tContextLoad.
7. If you need to use Proxy settings. then you can use tSetProxy. ( its optional)
8. Now on your DB Input component you can use the context.host , context.port variables for doing the connections..
For Example:
Properties File:
Path: C:\talendJob\properties\jobname\jobname.properties\myjob.properties
host=localhost
port=8080
database=mydb
Add the properties in the context tab
Name :host
Source:BuiltIn
Type: String
ScriptCode: context.host
JVM Argument
-Dmyarg.variable.docroot="C:\\talendJob"
In the tFileInputProperties FileName Textbox give: routines.MyJobRoutines.getDefaultPropertiesFile(jobName)
Create a Routine called MyJobRoutines:
public static String getDefaultPropertiesFile(String theJobName) throws Exception {
String propertiesFileName = System.getProperty("myarg.variable.docroot")
+ "/properties/"
+ theJobName
+ "/"
+ theJobName + ".properties";
return propertiesFileName;
}
Thanks,
Kumar.
Last edited by kumar (2010-10-05 06:25:35)
Offline
Hi,
This also happens in 4.1.1. I believe this is a bug since in previous versions you did not have to use tcontextload at the start of the job to initialize the context variables.
We find that you can pass the context from a trunjob to the subjob but cannot run the subjob as a standalone.
Any other ways around this??
Offline
Hi,
Just FYI - I opened a case with Talend and it is an issue that they can provided a fix for ()at least for 4.1.1).
Thanks,
Offline
Hello All
This problem have been reported and fixed on v411. see
http://www.talendforge.org/bugs/view.php?id=15212
Best regards
Shong
Offline
Pages: 1