Could not find the context PROD on a job deployed as a webservice

One Star

Could not find the context PROD on a job deployed as a webservice

HI to everyone,
I've working on TOS 5.4.1 for more than a year, and before that, I've been developping in J2EE environnements for more that 5 years.
I've been working on a job that works fine when executed inside Talend, whatever the context. So I've built it as a webservice and put in on a tomcat7 on a linux server to test it, with success.
Now, I'm moving to Production step, and when deploying, no problem. But when executing, in the log, I got : 
-  an error message : "COuld not find the context PROD"
- then the job execute the beggining of what it's supposed to do (starting with a Sysout in a tjava to print out the parameters received by the webservice), 
- and then, the first componant to touch one of my context variables, it throws a NullPointerException as it doesn't such variable.

In the job, I got several groups of contexts (for each DB or FTP), and I got 3 contexts : LOCAL (talend), DEV (integration server) and PROD (production server).

I built the job choosing PROD environnement obviously. And in the war extracted, I found inside "apache-tomcat/webapps/myJob_0.1/WEB-INF/classes/ipad/myjob_0_1/contexts" my 3 contexts.

i don't understand what's happenning, what am I missing, and why does this bug happens in production and not in Integration server with DEV context.

If i can bring you more details that will help me resolving this issue, please ask me, I'll be quick.

Thanks a lot for any help.

Seven Stars

Re: Could not find the context PROD on a job deployed as a webservice

Hi,

Do you have child jobs in your main job ? Can you put a screenshot of your job ?

Thanks,
Arnaud
One Star

Re: Could not find the context PROD on a job deployed as a webservice

Hi, here are some screenshot of my main job, which indeed calls child jobs.
Seven Stars

Re: Could not find the context PROD on a job deployed as a webservice

In your main job, you have child job.

When the main job running with the PROD context, the context is transmit. The fail is when a child job don't have the parent job context.

Verify if PROD context exist in all your child job. If the context don't exist in a child job, you have an error because the job don't find it as if you don't use context properties.

To avoid problems, always use same kind of context in all jobs like DEV, STAGING, PROD.
One Star

Re: Could not find the context PROD on a job deployed as a webservice

Thanks for your answer.
I have the same 3 context LOCAL, DEV, PROD in the main job and in all child jobs, with the exact same name, the only thing that's different seems to be the order of the contexts...
I don't know if that could be the cause.
Seven Stars

Re: Could not find the context PROD on a job deployed as a webservice

I just saw your screen with Ajout_doc properties. On the select context, choose default context (DEV i think) for all tRunJob component and check 'Transmit context'.

Can you screen your Ajout_doc job please ?
One Star

Re: Could not find the context PROD on a job deployed as a webservice

There it is.
I tried to export another job, also with child job and the same 3 contexts, and got the same problem.
Seven Stars

Re: Could not find the context PROD on a job deployed as a webservice

Can you verify if all parent context properties are in child context properties ?

2019 GARTNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog