Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I want to include a file which i am referring in my Talend Job.
I created a talend Routine which uses a file, I have loaded the file to routine along with jar file.
Now when i run the job in Local mode, Job is able to fetch the data from file, but when i run in job Server, It does not get the file.
help needed to resolve the issue
How to include the file in my project resources for remote run?
Thanks for detailed explanation,
I think, I am not able to make my issue clear:
I have a xml file named vmkeys.xml, which is required for my routine.
My routine code is accessing this file when ever i run my job.
I think my code routine always expects the file to be at Java Project Resources folder
I.e. C:\Talend\workspace\.Java\src\main\resources
If i remove the file from above directory my routine will fail
Now if i keep my file to any other directory say C:\Talend\workspace\.Java\src\main\resources1
In this case also my routine will fail
Question:
I want to know if i can change my job routine to start looking for the file "vmkeys.xml" in any other directory.
The reason i want this is, because in job server i dont have any corresponding project resource directory.
Generally Routines require static methods. Hence, yes, you can pass the path of the file to your routines. It can be an extra parameter to your routine method, which is the path of the file, that you pass when calling the routine.
If you call the routine frequently, you can setup a static private variable, create a method to set that variable, and call that method first thing in your job. Then every other routine methods can refer to the static variable which contains the path of the file. And then you load it as usual in your routine.
You will need a folder on your jobserver or on a shared drive (locked down so that only the job can access it if the content needs to be secured) where you will put this file.