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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Job with Subjobs error when deployed as OSGI (Karaf)

Hello there,

 

I have a job with a tRESTrequest entry point doing some json extract, parsing and launching other job depending on some parameters.

The job and subjobs are all running and ok when testing inside the studio (7.2) but when i deploy it as an OSGI bundle on a karaf server it doesn't work anymore, the main job is running ok but i get an error as soon as the subjob is called :

 

java.lang.RuntimeException: java.lang.NoClassDefFoundError ...

Caused by: java.lang.ClassNotFoundException: process.transfert_oracle_ged_1p_ts_ta_1_0.Transfert_Oracle_GED_1P_TS_TA cannot be found by process.WS_Transfert_Oracle_GED_Prod_1.0.0

 

If anyone can help that would be lovely!

Sincerely,
Nrd

Labels (3)
11 Replies
thomasmoren
Contributor
Contributor

Hi All,

 

I was fighting with the sub-jobs quite for a long time and I think I know the reason why some jars are not added.

My case:

Parent job has 3 components (tRestRequest, tXMLMap, tRestResponse)

SubJob contains tRestClient component (which does not exists in the parent)

 

If you run it locally, everything is ok, under Runtime fails with NoClassFound

 

The solution here is:

  • to add an instance of the component which is in the subjob, but no in the parent
  • most probably you would like to disable it because it is useless in the parent and won`t compile

Doing these two actions in the building process you will have the jars which are required for the child job to be run (e.g. jars for tRestClient added to compiled file)

 

This is the Parent Job having  tRestClient component disabled (but this gives instruction to OSGI to add this to the jar file

 

0683p000009M8oa.jpg

 

This is the child job having tRestClient in it

0683p000009M8of.jpg

 

I don`t know if it would work for everyone, but at least after spending nights and days trying to get this running, I was able to find this solution. At least works for me!

thomasmoren
Contributor
Contributor

When I have a job which is compiled as OSGI having a subjob, then if I compile it, then I get exception running in karaf:

java.lang.RuntimeException: java.lang.NoClassDefFoundError: org/apache/cxf/jaxrs/client/JAXRSClientFactoryBean

Caused by: java.lang.NoClassDefFoundError: org/apache/cxf/jaxrs/client/JAXRSClientFactoryBean

Caused by: java.lang.ClassNotFoundException: org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean cannot be found by ...

 

BUT

If I open my Subjob in Studio (as a separate job close to the parent) and then compile the same way Parent job, then my parent starts working fine without any issue.