Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Save $650 on Qlik Connect, Dec 1 - 7, our lowest price of the year. Register with code CYBERWEEK: Register
cancel
Showing results for 
Search instead for 
Did you mean: 
Sanjay5
Contributor III
Contributor III

How to include a file in Project Resource

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?

Labels (2)
12 Replies
Sanjay5
Contributor III
Contributor III
Author

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.

 

Anonymous
Not applicable

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.

MahiwalVinit
Creator
Creator

what is best practice
1. shared directory (through NFS or SMB mount)
2. Create the folders on job server and keep the file?