using org.apache.commons.codec.binary.Base64

Not applicable

using org.apache.commons.codec.binary.Base64

Hi there,
I am using OpenStudio 3.0.0M3 and facing a roblem with the commons codec Base64 encoder. I can't even use the encoder to be precise.
The class is part of the org.apache.commons.codec.binary inside the commons-codec-1.3.jar which is inside the ./lib/java folder. So I thought its already in the classpath and the only thing to do in my tJavaRow is to add the "import org.apache.commons.codec.binary.Base64" statement.
Sadly, this is not working. As I try to run the job I get an "java.lang.NoClassDefFoundError: org/apache/commons/codec/binary/Base64" exception.
I am accessing the class like "Base64.encodeBase64(something)" in my tJavaRow.
Could you please give me advise how to use this class?
Greetings,
Maximilian
Seventeen Stars

Re: using org.apache.commons.codec.binary.Base64

hi
Did you tried to add libraries thanks "preferences" !?
One Star

Re: using org.apache.commons.codec.binary.Base64

HI
This problem is very similar to what I faced with Apache modules.
Pls refere to this post.
http://www.talendforge.org/forum/viewtopic.php?id=4280

Do let me knw if it worked for you.
Regards
Surya
One Star

Re: using org.apache.commons.codec.binary.Base64

For me the solution with tLibraryLoad worked!
Thankyou very much!
Anyway maybe in the meanwhile something better has been implemented?
Thanks
Community Manager

Re: using org.apache.commons.codec.binary.Base64

For me the solution with tLibraryLoad worked!
Thankyou very much!
Anyway maybe in the meanwhile something better has been implemented?
Thanks

There are two ways to import and use a external jar.
- Use tLibraryLoad to load the jar in the job.
- Create a custom routine, import the jar in the routine and then call the routine in the job.
Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business