Article View: borland.public.jbuilder.java.language
Article #647Re: java.lang.ClassNotFoundException
From: John McGrath [TeamB]
Date: Wed, 06 Apr 2005 04:52
Date: Wed, 06 Apr 2005 04:52
33 lines
2051 bytes
2051 bytes
On 4/5/2005 at 10:13:12 PM, Lori M Olson [TeamB] wrote:
> This : "javax/mail/MessagingException" looks wrong.
>
> It's like someone is doing a
> Class.forName("javax/mail/MessagingException"), instead of using the
> proper Class.forName("javax.mail.MessagingException").
There are two different "no such class" Throwables:
java.lang.ClassNotFoundException
and
java.lang.NoClassDefFoundError
You get a ClassNotFoundException when you try to dynamically load a class
using Class.forName() or similar methods. This shows the full class name
with dots. For example: "com.acme.Widget".
You get a NoClassDefFoundError when a class that was on the path during
compilation cannot be found at run-time. This shows the full class name
with slashes. For example: "com/acme/Widget".
I do not think there is any real reason for this. I presume it is an
accident of implementation.
--
Regards,
John McGrath [TeamB]
---------------------------------------------------
Before sending me e-mail, please read:
http://www.JPMcGrath.net/newsgroups/e-mail.html
Technical Details
Message-ID:
<xn0e0nkay3q0e8u001@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news-out.newsfeeds.com!propagator3-LAX.newsfeeds.com!news-in.usenet.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<42529a40@newsgroups.borland.com> <425345b6$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: f74b3,fc63be902b12a6b7 X-Google-Attributes: gidf74b3,public X-Google-Language: ENGLISH,ASCII-7-bit From: "John McGrath [TeamB]" <ng-b@JPMcGrath.net> Subject: Re: java.lang.ClassNotFoundException Newsgroups: borland.public.jbuilder.java.language References: <42529a40@newsgroups.borland.com> <425345b6$1@newsgroups.borland.com> User-Agent: XanaNews/1.17.3.1 Message-ID: <xn0e0nkay3q0e8u001@newsgroups.borland.com> X-Ref: newsgroups.borland.com ~XNS:00000367 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 NNTP-Posting-Host: 141.158.34.113 Date: 5 Apr 2005 20:52:17 -0800 X-Trace: newsgroups.borland.com 1112759537 141.158.34.113 (5 Apr 2005 20:52:17 -0800) Lines: 33 X-Authenticated-User: jpmcgrath Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news-out.newsfeeds.com!propagator3-LAX.newsfeeds.com!news-in.usenet.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail