11

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?

RP-
  • 5,699
  • 2
  • 25
  • 43

3 Answers3

11

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.

install or download the external libraries

RP-
  • 5,699
  • 2
  • 25
  • 43
6

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.

Matthew Moisen
  • 12,418
  • 23
  • 90
  • 195
sdragnev
  • 456
  • 2
  • 9
  • 1
    Thank you llaen, After little bit of struggle came across `tLibraryLoad` component and the Other error was because of some other errors chained in the job. Thanks for your answer, +1 and accepted. – RP- Jul 10 '12 at 10:59
3

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

blo0p3r
  • 6,392
  • 7
  • 47
  • 67
Vikram Takkar
  • 62
  • 1
  • 1
  • I switched the accepted answer to this because the link provided in this answer is a better solution and explaining different approaches to add third party libraries. – RP- Mar 19 '15 at 18:08