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

Custom Code Routine runs well in the job but gives error when run in main job

Hi experts,

I wrote a custom code routine that will read data from .csv file (generated from the job), format it according to custom XY graph format coloring and such. Refer my job below:

0683p000009M4cv.png

I call the routine via tJava and below code settings:

routines.xyChart.main("Depth vs Days vs Cost");

 

The class I have created called xyChart. This java code runs well in Eclipse, runs well in the above job (its immediate job name eDepthDaysCost) and the parent job that calls eDepthDaysCost below:

0683p000009M4d0.png

The above job executes the user routine well, but it gives error when I run the whole main job like below:

0683p000009M4Zj.png

 

The error given:

0683p000009M4cD.png

 

All jobs (from main to its child that directly calls the custom code routine), has already be assigned with routine dependencies:

0683p000009M4dA.png

 

Please assists. Thanks in advance.

Labels (4)
3 Replies
Anonymous
Not applicable
Author

You should assign the routine dependencies to the routine and not the job. Take a look here for an explanation https://help.talend.com/reader/HqPypUO_cLctKv_dAWcgFw/NgHaZeMdd1TnGz1bm_Hayw

Anonymous
Not applicable
Author

Hi rhall,

Thanks for the reply. I have already removed Routine Dependencies in all jobs, and run the main job (top most job) again. In fact, I have put tJava in the top most job. The error still persists.

 

Please advice. Thank you.

Anonymous
Not applicable
Author

Sorry, I worded that very badly. Do not remove the "routine dependencies" on the jobs, in fact I would re-add them. I was talking about ensuring that you had the libraries related to your code directly linked with the routines, rather than doing it via the job (which lots of people used to do in previous versions.....but is not so easy now).

 

If that does not work, then it could be that this is caused by another jar in the dependencies that has the same class (maybe another version of the same library) that doesn't have the method that is reported in the error. It could also be down to an old version of the library. The java.lang.NoSuchMethodError is fired if some code tries to call a specified method of a class, and that class no longer has a definition of that method.

 

Is the job that is failing calling any methods of your routine that other jobs that are successful are not calling?