Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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

Anchor
Q1
Q1
*Why is

No Format
 jsp:useBean 

...

  • Your bean is packaged in a class.
  • You have fully qualified your class name (e.g.:

    No Format
     com.bar.package.MyClass 

    ) OR

  • You have imported your class into your jsp (e.g.:

    No Format
     <%@ page import="com.bar.package.MyClass"%> 

    )

Anchor
Q2
Q2
*Why do I get

No Format
 java.lang.NoClassDefFoundError: javax/servlet/Filter

...

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