[resolved] After export: ClassNotFoundException com.ibm.db2.jcc.DB2Driver
Hi,
my Talend jobs are structured as follows:
-job "RUN_ALL"
-job "RUN_SUBPROJECT1"
-job "RUN_SUBPROJECT2"
--sub project 1
---job x
---job y
--sub project 2
---job a
---job b
So, basically I have folders for several projects that contain several jobs. Furthermore, I have jobs that execute all jobs of a project, and on top of that a job that runs all jobs. That "RUN_ALL" job calls each "RUN_SUBPROJECTx" job.
Now I wanted to export RUN_ALL - so I can execute all jobs by executing one .bat. I checked everything in the export wizard and also included every file (in the file selection window on the left side). However, once I start the RUN_ALL.bat, it fails saying " ClassNotFoundException com.ibm.db2.jcc.DB2Driver".
When I export just the particular job at which the error occurs it runs fine. I also compared the export of the single job with the export of all jobs: It seems that there are some files missing in the "lib" folder in the export of all jobs. The export of the single job contains files like "db2.jcc.jar" and so on, which are missing in the "lib" folder of the export of all jobs.
I dont know....is it a problem that I nest the actual jobs? Because basically I call ALL_RUN which calls RUN_SUBPROJECTx which calls JOBx. So maybe when I export ALL_RUN it doesnt recognize the dependencies of the actual job files?
How can I solve the problem?
Best regards
Hi shong,
I just sent you an email with an example project. I used the name of this topic as subject so you can relate it to this issue.
Hope it helps.
Thanks!
Hi
Sorry for delay, I have imported your project and tried to export the job script from job All_RUN, I can see all the required drive jars are included in the lib folder. Please see what I do and what is not the same as your.
Maybe you have installed some patch cause the problem? If so, try to test it again on new studio.
Best regards
Shong
Hi!
No problem - just wanted to make sure that you got the email
Thanks for your response!
Back to topic. Well, I sent you the whole export, right? So please have a look at \ALL_RUN_0.1\lib\. It includes the following files:
advancedPersistentLookupLib-1.0.jar
commons-collections-3.2.jar
jboss-serialization.jar
jt400_V5R3.jar
jtds-1.2.5.jar
log4j-1.2.15.jar
systemRoutines.jar
talend_DB_mssqlUtil.jar
trove.jar
userRoutines.jar
after DELETING the call of the job Run_Ewim, the export contains MORE files in \lib\, new files are:
db2jcc.jar
db2jcc_license_cisuz.jar
db2jcc_license_cu.jar
So basically the missing db2 libraries.
I dont know, is there anything I can do? Doesnt seem reproducible at your machine, does it?
Hi
Yes, I can NOT reproduce the problem. see the screenshots in my previous post,
1. Right click on the job All_RUN, select 'export job' item.
2. Browse a path for archive file, click on the 'Finish' button.
After exporting the job script, I can see all the required drive jars are include in \ALL_RUN_0.1\lib\.
Best regards
Shong
Addition: Just saw that you added screenshots. Will check on a new Talend. Had no patches installed afaik.
Based on your screenshots I already saw 2 differences:
1) I checked "Context scripts" and "Apply to children"
2) I expanded the list of jobs (clicked ">>") and selected all jobs
But that wont do the trick I guess? Maybe you can try - I'll work on a fresh Talend in the meantime
Hi
1. If the job contains context variables, check the 'context scripts' and select the script file from the list when exporting the job script, I tested and it works, the job script include all the jars.
2. You don't need to click '>>' and select all jobs, because all the dependencies will be exported also when the 'Export dependencies' option is checked by default.
Best regards
Shong
HA! I think "2)" is our culprit!
If I dont select all jobs it seems like all libraries are getting exported correctly. Can you try again - but this time you do "2)" too? Maybe then the problem can be reproduced
Edit: Yes, can definitely reproduce it at my machine. If I select all jobs, the files are missing. If I just select ALL_RUN, the libraries get exported
Can you try again - but this time you do "2)" too? Maybe then the problem can be reproduced
Yes, I got the same problem if I click on '>>' and select all jobs, the driver for DB2 component are missing, please report a bug on our bugtracker.
Anyway, you don't need to select all jobs in your case, and you get the correct export of job script now.
Best regards
Shong