473,326 Members | 2,090 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

How to avoid NoClassDefError?

dmjpro
2,476 2GB
Please help!
And please differentiate between ClassNotFoundException and NoClassDefError.

Debasis Jana.
Jan 28 '08 #1
8 4974
r035198x
13,262 8TB
Please help!
And please differentiate between ClassNotFoundException and NoClassDefError.

Debasis Jana.
What do the specs say?
Note that one is an error while the other is an exception.
Jan 28 '08 #2
JosAH
11,448 Expert 8TB
Straight from the API docs:

public class ClassNotFoundException extends Exception

Thrown when an application tries to load in a class through its string name using:

The forName method in class Class.
The findSystemClass method in class ClassLoader .
The loadClass method in class ClassLoader.

but no definition for the class with the specified name could be found.


public class NoClassDefFoundError extends LinkageError

Thrown if the Java Virtual Machine or a ClassLoader instance tries to load in the definition of a class (as part of a normal method call or as part of creating a new instance using the new expression) and no definition of the class could be found.

The searched-for class definition existed when the currently executing class was compiled, but the definition can no longer be found.
kind regards,

Jos
Jan 28 '08 #3
dmjpro
2,476 2GB
Ok !
Both of you thanks but how could I avoid this Error?
One more thing the error comes with ....
java.lang.NoClassDefFoundError: com/oreilly/servlet/MultipartRequest
What is this????

Debasis Jana.
Jan 28 '08 #4
r035198x
13,262 8TB
Ok !
Both of you thanks but how could I avoid this Error?


Debasis Jana.
Just make sure the circumstances explained in the docs for that error to occur do not arise.
e.g Make sure you type your class names correctly when using the java command.
Jan 28 '08 #5
dmjpro
2,476 2GB
Just make sure the circumstances explained in the docs for that error to occur do not arise.
e.g Make sure you type your class names correctly when using the java command.
Actually the class exists!
But ....... when I try to get the instance then I can't get the Instance.
Please help!

Debasis Jana
Jan 28 '08 #6
r035198x
13,262 8TB
Actually the class exists!
But ....... when I try to get the instance then I can't get the Instance.
Please help!

Debasis Jana
Does it exist in that path that it's being looked for?
Jan 28 '08 #7
dmjpro
2,476 2GB
Does it exist in that path that it's being looked for?

I got it solved.
Thanks a lot guys!

Debasis Jana
Jan 28 '08 #8
Let me know how you solved it..please
Aug 6 '12 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

30
by: seesaw | last post by:
Is it right thing to always avoid using "new" to create objects? What if after starting the application, then decide which and how many objects to create? (Seems like under such situation is there...
6
by: | last post by:
I have a class with overloading operator new. (Because, if an identical object exists, return a pointer to existed object instead of a new pointer) It has no sense (it is dangerous) to allocate an...
3
by: Thomas Müller-Lynch | last post by:
How can I avoid late binding with the directive strict = tru My ASP .net-file looks like this <%@DEBUG=true TRACE=true Strict=false EXPLICIT=true% .. dim footerValues as Arra footerValues =...
32
by: KK | last post by:
Hello all, I have a unsigned char buffer 'buffer' and I need to convert the first 12 bytes of it into a string. Below is a code that should work, however, how can I avoid reinterpret_cast...
7
by: amit.atray | last post by:
Environement : Sun OS + gnu tools + sun studio (dbx etc) having some Old C-Code (ansi + KR Style) and code inspection shows some big size variable (auto) allocated (on stack) say for ex. char...
6
by: howa | last post by:
Since it is part fo the standard, why I always heard that we should avoid iframe? any comments? thanks.
5
by: Kevin | last post by:
Hi! Is there anyway to avoid flicking between pages navigation in Asp.Net 2.0, like smartnavigation atribute in asp.net 1.1? Thanks and Regards.
4
by: DC | last post by:
Hi, the subject says it all. Since visible=false controls will still run though Page_Load, I was hoping that the MultiView would somehow manage to avoid a Page_Load of controls in its inactive...
11
Niheel
by: Niheel | last post by:
http://bytes.com/images/howtos/information_overloaded.jpgPaul Graham wrote an interesting article a few months back about how the internet is leading to information overload for information workers...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.