my dog learned polymorphism*
The moose likes Servlets and the fly likes java.lang.NoClassDefFoundError: org/apache/commons/codec/binary/Base64 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "java.lang.NoClassDefFoundError: org/apache/commons/codec/binary/Base64" Watch "java.lang.NoClassDefFoundError: org/apache/commons/codec/binary/Base64" New topic
Author

java.lang.NoClassDefFoundError: org/apache/commons/codec/binary/Base64

Farakh khan
Ranch Hand

Joined: Mar 22, 2008
Posts: 726
Hello,

I have dedicated server with RHE

When its running the program then its throwing the following error:



What I did is:

1) I placed base64coder.jar in /WEB-INF/lib
2) I also copies the file to jdk/jre/lib/ext
3) I un-jar and made folder org/apache/commons/codec/binary/Base64/Base64Coder.class in /WEB-INF/classes

Nothing worked so far. Please help me

Thanks & best regards


Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60063
    
  65

(1) Is all you need to do.

If that's not working then either: (a) the class isn;t in the jar file, or (b) your web app is structured incorrectly such that the lib folder isn't getting loaded.

I have dedicated server with RHE

I have no idea what this means.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Farakh khan
Ranch Hand

Joined: Mar 22, 2008
Posts: 726
I un-jar and class exist
How can I check that lib folder is loaded or not?

thanks for replying
Farakh khan
Ranch Hand

Joined: Mar 22, 2008
Posts: 726
This is Tomcat log

Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
What is "base64coder.jar"? It sure doesn't sound like the name of an Apache Commons jar file (which would be something like commons-codec-1.5.jar).

org/apache/commons/codec/binary/Base64/Base64Coder.class

The Commons Codec library has no such class - what is that supposed to be?
Farakh khan
Ranch Hand

Joined: Mar 22, 2008
Posts: 726
Tim Moores wrote:What is "base64coder.jar"? It sure doesn't sound like the name of an Apache Commons jar file (which would be something like commons-codec-1.5.jar).


Dear Bear Bibeault & Tim Moores,

Thanks from the bottom of my heart.

You are right Tim Moores.
The problem was jar file. When I checked the unjar package then this was biz_source_code_Base64 package instead of org.apache.....

Problem fixed

Best regards
Damian Kober
Greenhorn

Joined: Aug 15, 2013
Posts: 2
I added tomcat-util.jar to the class path and that made it work (it contains the codec class)

build.xml

<path id="catalina-ant-classpath">
<!-- We need the Catalina jars for Tomcat -->
<!-- * for other app servers - check the docs -->
<fileset dir="${appserver.lib}">
<include name="catalina-ant.jar"/>
<include name="tomcat-util.jar"/>
</fileset>
</path>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java.lang.NoClassDefFoundError: org/apache/commons/codec/binary/Base64
 
Similar Threads
Struts example with HFS&J not working
Hex to jpeg conversion
Uploading images with jsp
Byte[] to String and Back
Converting a Base64 encoded String to an Image