How to add third party libraries to Talend project

2020-02-28 03:46发布

问题:

How to add third party libraries (jar files) to a Talend project ?

One more question is, Each Talend component uses LogFactory, but in my case it is throwing

java.lang.NoClassDefFoundError: org.apache.commons.logging.LogFactory
    at ...

with tSetGlobalVar component, how can I make use of existing logging library to get rid of this exception?

回答1:

You can import the external jars using tLibraryLoad component or Editing Routine Libraries.

For more information visit

http://vikramtakkar.blogspot.in/2013/03/importing-external-jar-or-library-files.html



回答2:

Just to benefit others, with recent release of Talend, they have removed the User libraries.

We need to use the Modules to see, download or install new libraries. We can add Modules view by going to Window -> Show view -> Talend -> Modules. From the Modules section we can manage all the external libraries.



回答3:

There are two ways to add additional libraries.

  1. Window -> Preferences -> Java -> Build Path -> User Libraries This will include jar files for all the project jobs.

  2. Use the tLibraryLoad component to load a lib file in a job.

As for your second question, this should work out of the box, but it's possible you somehow have a file missing. In your Talend install path, check the plugins directory. The apache logging jar file should be there. In my case: org.apache.commons.logging_1.1.1.v201005080502.jar

If it's missing, then I'd suggest reinstalling Talend (it shouldn't be missing). If it's there, but you're still getting the error, try including it explicitly in the user libraries as described above.



标签: java etl talend