Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 923411
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T19:11:20+00:00 2026-05-15T19:11:20+00:00

NoClassDefFoundError extends LinkageError which in turns extends Error. Javadoc for Error class states: An

  • 0

NoClassDefFoundError extends LinkageError which in turns extends Error.

Javadoc for Error class states:

An Error is a subclass of Throwable
that indicates serious problems that a reasonable application
should not try to catch.

Class loading methods like Class.forName() only declares ClassNotFoundException in throws clause. Which, in addition to above description of Error means that we should not be usually catching the NoClassDefFoundError when loading classes with Class.forName() etc.

My question is what are the conditions in which NoClassDefFoundError is thrown instead of ClassNotFoundException?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T19:11:21+00:00Added an answer on May 15, 2026 at 7:11 pm

    ClassNotFoundException is more likely to be thrown (to your code) in situations where you’re manually loading classes – precisely for things like Class.forName(). These names may come from user input, for example.

    NoClassDefFoundError will occur when a class file itself refers to a class that then can’t be found. The class was present at some time, but now isn’t – this isn’t just a bug in the code that’s trying to do reflection, it’s a deployment mistake of not making all the required classes available. As far as I can tell a NoClassDefFoundError will usually or possibly always wrap a ClassNotFoundException – but the point is that this isn’t something your code is meant to guard against, as it indicates an environment which is probably too broken to recover from.

    At least, that’s my understanding 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to run a class, but I get the following error: java.lang.NoClassDefFoundError:
I have servlet that does the following: public class LoginServlet extends HttpServlet { protected
may i know which jar is this class java.lang.NoClassDefFoundError: org/springframework/metadata/Attributes located? i cannot find
I have a mapview class which extends MapActivity. The code i'm using follows the
I got this error E/AndroidRuntime(475): java.lang.NoClassDefFoundError: com.google.gdata.client.youtube.YouTubeService When I try to run Youtube data
I am getting this error when ever deploying my jsf application java.lang.NoClassDefFoundError: javax/servlet/jsp/jstl/core/Config at
I'm tring to use com.google.android.apps.analytics.GoogleAnalyticsTracker but got NoClassDefFoundError when GoogleAnalyticsTracker.getInstance(); I'm sure that libGoogleAnalytics.jar
if I run java -classpath ./sqljdbc4.jar myclassname error is Exception in thread main java.lang.NoClassDefFoundError:myclassname
Netbeans is returning a NoClassDefFoundError, but my class is right there! Has this happened
I get a java.lang.NoClassDefFoundError: com/hp/hpl/jena/shared/BadURIException when running a very simple servlet. The error points

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.