Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

context parameter in java to TALEND job

hi,
i want to pass one context variable from java code to talend job.The vaue contains path of CSV file.
I want to pass that path value to 'tFileInputDelimited' component and then to MSSQL database.
First 'tFileInputDelimited' is empty but File name/Stream has file path passed from javacode.
Now 'tMap' component is empty.
How to solve this problem?
One more doubt is how can i get context variable 'file_path' (which is defined in java code) in TALEND JOB and set path value to 'File name/Stream' of  ''tFileInputDelimited'' component.
please look into screenshots for better understanding of my problem.
0683p000009MCsB.png 0683p000009MCcF.pngI tr 0683p000009MCsL.png 0683p000009MCsQ.png
Labels (4)
5 Replies
Anonymous
Not applicable
Author

Hi praveen522,
Have you already checked the document about TalendHelpCenter:How to define context variables for a Job?
Why don't you set your file path value in Context view? Did you want to mask your file path in your job by using javacode?
Best regards
Sabrina
Anonymous
Not applicable
Author

thanks shong for your quick replay.
Yes i need to pass file path from JAVA code  to TALEND job.
You can see in my java code i set filepath value.i need to use that value in my TALEND JOB.
Tell me how can i use file path of java code in TALEND JOB.
Anonymous
Not applicable
Author

any update xdshi??
Anonymous
Not applicable
Author

Hi,

I think you have already read this KB article TalendHelpCenter:Calling a Talend Job from an external Java application
We see your code is OK to call the job from eclipse and pass the  new values to context variable.
So now, what is the problem if you run the java code?
Best regards
Sabrina
Anonymous
Not applicable
Author

hi xdshi,
I think you will understand my problem clearly and identify mistake i made once you go through my new screenshots attached below.
In return i am getting "org.xml.sax.SAXException" in java class(refer screenshot 1).
EXCEPTION:
org.xml.sax.SAXException : Deserializing parameter 'item':  could not find deserializer for type { http://talend.org}ArrayOf_xsd_string.

Have a look at screenshots.Identify the mistake i done here.
0683p000009MCsV.png 0683p000009MCl1.png 0683p000009MCsa.png 0683p000009MCsf.png