• Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » Could not find the context Default

#1 2010-06-18 15:30:37

toinz
Guest

Could not find the context Default

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

#2 2010-10-04 23:52:29

Zohaib
New member
Registered: 2010-09-09
Posts: 9

Re: Could not find the context Default

I am also facing a similar issue.  It would be great if someone could help!!

Offline

#3 2010-10-05 03:22:31

Zohaib
New member
Registered: 2010-09-09
Posts: 9

Re: Could not find the context Default

239 views and no reply!!!

Offline

#4 2010-10-05 06:24:51

kumar
Member
Registered: 2010-09-23
Posts: 18

Re: Could not find the context Default

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

#5 2011-01-19 19:18:57

tnewman
Member
Company: Lunexa
Registered: 2008-11-15
Posts: 194
Website

Re: Could not find the context Default

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??


------------------
Talend Version - TIS 4.1.2
Generated Code - Java
OS - WinXP SP3 / Linux

Offline

#6 2011-01-21 01:07:20

tnewman
Member
Company: Lunexa
Registered: 2008-11-15
Posts: 194
Website

Re: Could not find the context Default

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,


------------------
Talend Version - TIS 4.1.2
Generated Code - Java
OS - WinXP SP3 / Linux

Offline

#7 2011-01-25 07:46:58

shong
Talend team
Registered: 2007-08-29
Posts: 10305
Website

Re: Could not find the context Default

Hello  All
This problem have been reported and fixed on v411. see
http://www.talendforge.org/bugs/view.php?id=15212

Best regards
Shong


Email:shong@talend.com
Choose Talend, Enjoy Talend!
New & Event: Talend Help Center
Talend-->the leader of open source data management and application integration solutions!

Offline

  • Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » Could not find the context Default

Board footer

Powered by FluxBB