The hash is not initialized - launching job by sh

Seven Stars

The hash is not initialized - launching job by sh

Hi,

 

I have a issue. My job is working perfectly with tHashOutput and tHashInput if in tFileInputPositional and tFileOutputDelimited I put the file path (ex. "/tmp/file.txt")  (ex. "/tmp/out.txt"). I created 2 context variable fileInput and fileOutput to do the same things, but in order to run myJob by .sh, outside Talend. I replaced my "/tmp/file.txt" by context.fileInput and "/tmp/out.txt" by context.fileOutput. I want to passing file at runtime. After building the job I am trying to run it by .sh, but I got the following error:

 

Exception in component tHashInput_1 (mainElabGal_Alf)
java.lang.RuntimeException: The hash is not initialized : The hash must exist before you read from it
at gal.mainelabgal_alf_0_1.mainElabGal_Alf.tHashInput_1Process(mainElabGal_Alf.java:1318)
at gal.mainelabgal_alf_0_1.mainElabGal_Alf.runJobInTOS(mainElabGal_Alf.java:25401)
at gal.mainelabgal_alf_0_1.mainElabGal_Alf.main(mainElabGal_Alf.java:25246)

 

My .sh:

./mainElabGal_Alf_run.sh --context_param fileInput=/tmp/file.txt --context_param fileOutput=/tmp/out.txt

 

I attached my job. Does anyone could help me please?

Thank you in advance!!


Accepted Solutions
Forteen Stars

Re: The hash is not initialized - launching job by sh

@Emanuele89 ,you need to create a dependency that all the data has loaded in tHashout to read those using tHashInput. check belowUntitled.png way.

 

Manohar B
Don't forget to give kudos/accept the solution when a replay is helpful.

All Replies
Forteen Stars

Re: The hash is not initialized - launching job by sh

@Emanuele89 ,you need to create a dependency that all the data has loaded in tHashout to read those using tHashInput. check belowUntitled.png way.

 

Manohar B
Don't forget to give kudos/accept the solution when a replay is helpful.
Seven Stars

Re: The hash is not initialized - launching job by sh

Hi,

thank you for your reply.

How can I create a dependecies? I cannot link all my tFileInputPositional with "onSubjokOK" to "tHasInput". I can do this with only the first one. For the others I tried "onComponentOK", but it is not working Smiley Sad

Seven Stars

Re: The hash is not initialized - launching job by sh

@manodwhb 

I solved it! I linked all my tFileInputPositional by "onSubjobOk", the I linked the last one and I linked it to the first tHashInput.

Thank you for your help!!

What’s New for Talend Spring ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Downloads and Trials

Test drive Talend's enterprise products.

Downloads