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

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

Loading more than one *jar with tLibraryLoad

Hi,
I encountered another problem while working with TOS. For my JavaFlex-Code I need to import four *jars and a bunch of dependencies. I thought that it may be solved by putting all *.jar into <TOS installation path>/lib/java and putting a tLibraryLoad component with import-statements in the job.
This did not work, so I checked the path for external libs in perferences. Everything is fine it points to <TOS installation path>/lib/java.
So I tried to load every *jar with tLibraryLoad this only works for one component, after the second and third one is added nothing works anymore. And only the last added *.jar is recognized.
Something like this:
---onSuccess OK ----> ---onSuccess OK ----> --- onSuccess OK ----> ...

I beginning to get crazy. Maybe I should program it all by-hand as my dearest consultant ;-).

Best regards und thanks in advanced,
Danny
Labels (4)
21 Replies
Anonymous
Not applicable
Author

Hi Danny
This problem has already been reported as bug.
Ref. https://community.talend.com/t5/Design-and-Development/org-talend-designer-components-commons-cannot...
Thanks
Surya
Anonymous
Not applicable
Author

Thanks for the reply.
Is there another way to provide TOS with external libs? I tried to put the jars in the lib/java folder of Talend Open Studio, created a separate user lib in perferences or added a classpath variable there. But after even restarting TOS the classes in that external lib are not resolved.
How do you import external libs to a job?

Thanks,
Danny
_AnonymousUser
Specialist III
Specialist III

Same issue as well.
Is there any workaround in the meantime ?
Thank you
Anonymous
Not applicable
Author

Hi,
I saw that the bug is resolved. So I tried to download the source for building the responsible class (org.talend.librariesmanager.model.ModulesNeededProvider). But somehow it does not work I get an error from TOS:
An internal error occurred during: "Initialisierung der Generator-Engine wird durchgeführt...".
Unresolved compilation problems:
ModuleNeeded cannot be resolved to a type
Missing code implementation in the compiler

My question is, can someone provide me a nightly build or a intermediate binary from TOS. It would be enough if someone could give me a right compiled version of ModulesNeedeProvider.
Any other workaround would be also appreciated.

Thanks,
Danny
Anonymous
Not applicable
Author

Hi,
is there really noone who has to put external libs to their jobs and found a work around for the tLibraryLoad bug? Or build TOS from SVN?

Thanks in advanced,
Danny
Anonymous
Not applicable
Author

My workaround was to exit the Studio after adding each new library. The start it again and add another. I had to do it for most of the libraries, but some got added ok.
Now I finally added them all and after another restart this thing actually runs
Anonymous
Not applicable
Author

Hi,
the problem is solved with the new release.

Danny
_AnonymousUser
Specialist III
Specialist III

Hi,
I tried for the first time to use this component with 2 jars, but it seems to work quite randomly (with TOS 3.0.1) and I face the same symptoms (jar is copied to <TOS installation path>/lib/java, but does not appear in the .classpath, or appears and disappears at random, and org.talend.fileprocess cannot not found). Is this issue really fixed?
As a workaround, I tried to put the sources of the jars I use in the project, but I cannot figure out what is the right place to do this (if such a place exists). It works if a put them in .Java/src, but of course they are removed when the project is closed?
By the way, it looks that tLibraryLoad does not work for Job building, but works for runtime dependencies. Indeed I only had to put the source of the package I use directly from the job, but not the dependancies of that package.
Also, wouldn't it be much simplier if there was a directory to put jars in each project, and all jars in that directory would be added to the classpath automatically? Better have too much libs at build/run time than have classpath problems? Once the job is exported, the superfluous jars might still be removed.
_AnonymousUser
Specialist III
Specialist III

How do we use external jars in Talend? I am writing functions that use external jars, not able to figure out how to set the external jars in classpath or libraries.

Thanks