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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[resolved] UserRoutines.jar only packs routines used by the job

Hello guys, I'm with a problem that I really expect to have a good solution 0683p000009MACJ.png
Let's begin with an example:
I have a job JobA that uses RoutineA and RoutineCommon and I have a job JobB that uses RoutineB and RoutineCommon.
All these Routines were created by me, they aren't system routines 0683p000009MA9p.png. Also, both jobs are in the sabe project.
Lets say that I build JobA and put it in production. When I open my lib/UserRoutines.jar I can see RoutineA.class and RoutineCommon.class.
So, then I need to put JobB in production. I build JobB and put in production in the same server that JobA already is (because I'd like to have one lib folder shared through all my jobs, this way I'd avoid having a lot of duplicateds .jar files). 
So the structure of my production server would be something like this:
root
|-- lib
|-- JobA
|-- JobB
Ok, then I go to my lib/UserRoutines.jar just to check that all my classes are there and, for my BIG surprise, only  RoutineB.class and RoutineCommon.class are there. Where is the RoutineA.class?
Then I try to run my JobA and what happens???   it fails to run, saying that RoutineA is missing.
Solutions that I thinked about:
1: declare routine dependencies to All my jobs (this I believe is ridiculous, imagine if I have 100s of jobs, and then I create a new Routine to one new job..... 0683p000009MA5A.png...I'd had to add this new Routine dependency to all my 100s of job, because is suddenly I'd need to change one of them, it would broke these new job)
2: create one job (let's call it JobRoot) and set all the dependencies ALWAYS to only it, all the other jobs would have only the dependecies it needs. Doing this, every time I deploy one job  (old or new) I would have to deploy this  JobRoot after, to make sure that all ohter jobs wouldn't break.
3:create one lib for each job (actually, this is not a option for me 0683p000009MAB6.png )
So, I really think that it must have some configuration or anything else that would avoid me from any of these solutions (but I don't know it 0683p000009MACJ.png)
I'd like to hear opinions and suggestions 0683p000009MACJ.png.

Thanks in advance 0683p000009MA9p.png
Gabriel
Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

From my experience...
If you create a routine and then create a Job, the routine is automatically added.
If you create a Job and then create a routine, you must manually add the routine.
I've also noticed that, at least in some versions, a Job will work in Designer without manually adding the routine (scenario 2); but the routine is not available when you "Build Job".
I think there are some inconsistencies and I can see the issue if you want a common lib file.
There may be a smarter answer; but the idea of periodically creating a "root" Job that should automatically have all routines added may be a workable option.

View solution in original post

4 Replies
Anonymous
Not applicable
Author

Hi Gabriel 
Ok, then I go to my lib/UserRoutines.jar just to check that all my classes are there and, for my BIG surprise, only  RoutineB.class and RoutineCommon.class are there. Where is the RoutineA.class?

Which version are you using? There might be a bug in the version you are using? I just tested this issue with version 5.5.0 and it works, I can see all of the user routines class in   lib/UserRoutines.jar

Best regards
Shong
Anonymous
Not applicable
Author

From my experience...
If you create a routine and then create a Job, the routine is automatically added.
If you create a Job and then create a routine, you must manually add the routine.
I've also noticed that, at least in some versions, a Job will work in Designer without manually adding the routine (scenario 2); but the routine is not available when you "Build Job".
I think there are some inconsistencies and I can see the issue if you want a common lib file.
There may be a smarter answer; but the idea of periodically creating a "root" Job that should automatically have all routines added may be a workable option.
Anonymous
Not applicable
Author

Hi Shong
Which version are you using? 

I'm using Talend for ESB 5.5.1 (r118616).
There may be a smarter answer; but the idea of periodically creating a "root" Job that should automatically have all routines added may be a workable option.

I agree tal00000, and I'm hoping there's a smarter answer 0683p000009MA9p.png
Thanks,
Gabriel
Anonymous
Not applicable
Author

Hi Gabriel 
If you create a routine and then create a Job, the routine is automatically added.
If you create a Job and then create a routine, you must manually add the routine.

As tal0000 said,  if the routine class isn't export when you build job, right click on the job and select 'setup routines dependencies' item, and add the user routine manually.
Best regards
Shong