Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Problem with type password as context variable

Good afternoon,
I've got an issue when I use a context variable which type is password.
When I tried to execute it (without any others components), I get the following error :
routines.system.JSONException: JSONObject not found.
       at routines.system.JSONObject.get(JSONObject.java:363)
       at routines.system.ResumeUtil.convertToJsonText(ResumeUtil.java:339)
       at gouvernance_2012.testaaa_0_1.testaaa.runJobInTOS(testaaa.java:429)
       at gouvernance_2012.testaaa_0_1.testaaa.main(testaaa.java:304)

In attachment the job I tried to execute.
I've just installed the TOS DI 5.6.0, it was not a problem on my last Talend 5.0.1.
How could i fixed that ?
Thanks a lot for your help !

0683p000009MBbu.png
Labels (4)
9 Replies
Anonymous
Not applicable
Author

Hi,
What's your current job? Is it OK without using Context Variable in your job?
Best regards
Sabrina
Anonymous
Not applicable
Author

Hi,
First of all, do you necessarily need the password to be saved with your job. Decoupling the code & the credentials is almost generally a better practice. 0683p000009MACn.png
Having said that, the same thing worked on my Talend (v5.2.2). So, I don't see any reason for it to not work for your version.
Just a pointer, I hope you have configured the job to specifically pick the values from within the saved values & the job isn't looking for the value in a config file.
Hope this helps. Let me know if it doesn't.
MathurM
Anonymous
Not applicable
Author

Hi bouga,
When you use password datatype in context then in older version: You will see the value as db_apssword = "test". But in 5.6: You will see the password value in in binary like db_password = 5e7h1j56271809b5. That is the reason you are getting password as null.
Can you please change the password datatype in 5.6 from "password" to "String" and try once? Thank you!
May be this is a bug I guess. 
Regards
Srikanth
   
Anonymous
Not applicable
Author

Hi bouga,
When you use password datatype in context then in older version: You will see the value as db_apssword = "test". But in 5.6: You will see the password value in in binary like db_password = 5e7h1j56271809b5. That is the reason you are getting password as null.
Can you please change the password datatype in 5.6 from "password" to "String" and try once? Thank you!
May be this is a bug I guess. 
Regards
Srikanth
   

Thanks everybody for your answers !
That's true, when I put my variable in String, now I don't have the error and everything looks good.
Except I have to open manually every jobs using my password variable to apply the modification I have done in my context environnement (you can see in attachment, maybe between 500 and 1000 jobs on my 4 projects 0683p000009MACn.png)) ). Is there a way to do that ? Or do I have to migrate in 5.5.1 (if there is not this problem) ?
Thanks a lot !

0683p000009MBen.png
Anonymous
Not applicable
Author

Hi Bouga,
You can use tContextLoad component in order to read the password dynamically from the file. You no need to do manually for each Job.
Please refer the "tContextLoad" example. Please let me know if it helps you? Thank you.
Regards
Srikanth
Anonymous
Not applicable
Author

Hi Bouga,
You can use tContextLoad component in order to read the password dynamically from the file. You no need to do manually for each Job.
Please refer the "tContextLoad" example. Please let me know if it helps you? Thank you.
Regards
Srikanth

Hi srikantharavapalli,
Thanks a lot for your answer, I'm already using a tContextLoad at the beginning of my jobs but the problem is here.

0683p000009MBes.png
_AnonymousUser
Specialist III
Specialist III

Hi All
I have found what appears to be a workaround. If the Password context begins with the first two letters of another context or "Pa" you get the above error. e.g
Contexts: Database , Hosts , Login
Names that fail for the Password context : Da.... , Ho....., Lo.....
Names that work : all except above. This is case sensitive so da.... and ho.... work
Cheers
Ian
Anonymous
Not applicable
Author

Hi All.
I can confirm that renaming the context var from "Mydatabase_Password" to "DBMydatabase_Password" does effectively resolve the problem.
I hope it'll be fixed soon.
MoeyE
Partner - Creator III
Partner - Creator III

Live saver! This actually worked.