The moose likes Spring and the fly likes  java.lang.NoClassDefFoundError: org/apache/tomcat/util/buf/B2CConverter Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark " java.lang.NoClassDefFoundError: org/apache/tomcat/util/buf/B2CConverter" Watch " java.lang.NoClassDefFoundError: org/apache/tomcat/util/buf/B2CConverter" New topic

java.lang.NoClassDefFoundError: org/apache/tomcat/util/buf/B2CConverter

Az Hanif

Joined: Aug 30, 2011
Posts: 3
Hi All,

First post so apologies if i dont provide enough info.

Basically im running through the example spring MVC tutorial on spring source and came across the following error. Tried the standard googling but couldnt find anything to help me resolve it.

C:\dev\springapp\build.xml:133: java.lang.NoClassDefFoundError: org/apache/tomcat/util/buf/B2CConverter
at org.apache.catalina.util.Base64.encode(Base64.java:177)
at org.apache.catalina.ant.AbstractCatalinaTask.execute(AbstractCatalinaTask.java:204)
at org.apache.catalina.ant.AbstractCatalinaTask.execute(AbstractCatalinaTask.java:150)
at org.apache.catalina.ant.ListTask.execute(ListTask.java:51)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:390)
at org.apache.tools.ant.Target.performTasks(Target.java:411)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
at org.apache.tools.ant.Main.runBuild(Main.java:809)
at org.apache.tools.ant.Main.startAnt(Main.java:217)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Caused by: java.lang.ClassNotFoundException: org.apache.tomcat.util.buf.B2CConverter
at org.apache.tools.ant.AntClassLoader.findClassInComponents(AntClassLoader.java:1361)
at org.apache.tools.ant.AntClassLoader.findClass(AntClassLoader.java:1311)
at org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader.java:1064)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
... 21 more

Any help would be much appreciated and thanks in advance!
Raja Pal
Ranch Hand

Joined: Jul 12, 2004
Posts: 92
Hey Hanif, Looks like you are using the tomcat server. Check your classpath to be set correctly and that tomcat-utilXXX.jar is in your classpath. The stated classs is missing in your classpath or you are deploying to an older version of the server, which does not have the stated class B2Cconvertor. Please look into your server/lib directory if you don't find the class.

Hope this helps!

Java Pal - Your friend in technology and innovation...India.
Az Hanif

Joined: Aug 30, 2011
Posts: 3
wil give it a shot and let oyu know.

Boechi Loco

Joined: Apr 19, 2011
Posts: 2
To get it working in tomcat 7 I had to put
- tomcat-coyote.jar and
- tomcat-util.jar
from the lib directory and
- tomcat-juli.jar
from the bin directory on my classpath.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: java.lang.NoClassDefFoundError: org/apache/tomcat/util/buf/B2CConverter
Similar Threads
java.lang.NoClassDefFoundError: org/apache/tomcat/util/buf/B2CConverter
Ant error on trying to run an taskdef
ftpclient class not found?
Need help in build applications using ant : getting exception