Differences between revisions 13 and 14
Revision 13 as of 2011-07-29 19:54:23
Size: 2336
Comment: Add Tomcat 7.0 documentation link
Revision 14 as of 2013-01-30 00:24:37
Size: 2257
Comment: Correct file names.
Deletions are marked like this. Additions are marked like this.
Line 7: Line 7:
  * Classloader HOWTO pages: [[http://tomcat.apache.org/tomcat-7.0-doc/class-loader-howto.html|Tomcat 7.0]], [[http://tomcat.apache.org/tomcat-6.0-doc/class-loader-howto.html|Tomcat 6.0]], [[http://tomcat.apache.org/tomcat-5.5-doc/class-loader-howto.html|Tomcat 5.5]].   * Classloader HOWTO pages: [[http://tomcat.apache.org/tomcat-7.0-doc/class-loader-howto.html|Tomcat 7.0]], [[http://tomcat.apache.org/tomcat-6.0-doc/class-loader-howto.html|Tomcat 6.0]].
Line 29: Line 29:
You probably have servlet.jar floating around somewhere it shouldn't be. This really messes up the classloaders since Tomcat's classloaders don't act quite as normal as one expects (see links above). servlet.jar should only be found only once in $CATALINA_HOME/common/lib. You probably have servlet-api.jar floating around somewhere it shouldn't be. This really messes up the classloaders since Tomcat's classloaders don't act quite as normal as one expects (see links above). servlet-api.jar should only be found only once in $CATALINA_HOME/lib.

Class Not Found Issues

Preface

This page discusses the various ways you see Class Not Found errors or very similar errors. It is strongly advised you read the following topics:

If you get a NoClassDefFoundError exception, the root cause might be the same as for a ClassNotFound exception.

Questions

  1. Why is jsp:useBean is not working?

  2. Why do I get java.lang.NoClassDefFoundError: javax/servlet/Filter?

  3. Why do I get java.lang.NoClassDefFoundError: org/xml/sax/InputSource?

Answers

Why is  jsp:useBean  is not working?

Make sure:

  • Your bean is packaged in a class.
  • You have fully qualified your class name (e.g.: com.bar.package.MyClass ) OR

  • You have imported your class into your jsp (e.g.:  <%@ page import="com.bar.package.MyClass"%> )

Why do I get  java.lang.NoClassDefFoundError: javax/servlet/Filter?

You probably have servlet-api.jar floating around somewhere it shouldn't be. This really messes up the classloaders since Tomcat's classloaders don't act quite as normal as one expects (see links above). servlet-api.jar should only be found only once in $CATALINA_HOME/lib.

Why do I get  java.lang.NoClassDefFoundError: org/xml/sax/InputSource ?

You have conflicting XML api jar files in your classpath. Read the README or RELEASE-NOTES for more information.


CategoryFAQ

FAQ/Class_Not_Found (last edited 2013-01-30 00:24:37 by KonstantinKolinko)