Skip to main content
Announcements
A fresh, new look for the Data Integration & Quality forums and navigation! Read more about what's changed.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

ClassNotFoundException: java.lang.NoClassDefFoundError

Hi there;

In one of my tJavaRow I’m using the library “org.apache.commons.lang3” where I use the Static class StringUtils and the method isBlank().

Obviously I added the java import org.apache.commons.lang3.StringUtils; on the advance tab of the tJavaRow.

 

The code compiles properly!

But at run time I get:

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/lang3/StringUtils

Caused by: java.lang.ClassNotFoundException: org.apache.commons.lang3.StringUtils

 

So it compiles! therefore the compiler found the library!!!

But not the run time???

 

The library is physically in the following path under the Talend install:

 

0683p000009LsSC.png

 

 

 

 

Talend knows that it is there as shown here:

0683p000009Lt1E.png

 

 

 

 

 

 

So what is out of synch that the compiler finds it but not the run time and how do I fix it.?

Do I add reference in one of the POMs?

 

 

Labels (3)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Ok Since I'm back around I'll note my findings so others can benefit.

 

The issue is that talend was installed with Admin privileges and now when I run it without admin right I get the error above. If I run it with admin rights (run as administrator) it works fine!

 

Not intuitively obvious!!

 

View solution in original post

4 Replies
Anonymous
Not applicable
Author

Hello,

Do you want to install external jar file into studio?

There are two ways for you to import and use an external jar.
1)Using tLibraryload component to load the jar file at the begininig of job. for example:
tLibraryLoad
   |
tJava(on tJava, use the external API)

2)Creating custom routine, import the external jar file by clicking on the routine name and editing the routine libraries, and then call this routine in the job.

Best regards

Sabrina

 

Anonymous
Not applicable
Author

Hi there;

 

Maybe I do not understand the meaning of what I am seeing.

Given both images in my initial posting specially in the second which is specifically related to "installation details"

I would have expected that the package was there and visible. Specifically that given the import statement the code compiles.

 

Anyhow at this point it is mystery as I think some configuration is out of synch but the tLoadLibrary did work.

Anonymous
Not applicable
Author

Ok Since I'm back around I'll note my findings so others can benefit.

 

The issue is that talend was installed with Admin privileges and now when I run it without admin right I get the error above. If I run it with admin rights (run as administrator) it works fine!

 

Not intuitively obvious!!

 

Anonymous
Not applicable
Author

Hello,

Thanks for sharing your solution with us.

Best regards

Sabrina