This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 37191 - CNFE in PersistenceObjectRegistry.loadClass
Summary: CNFE in PersistenceObjectRegistry.loadClass
Status: RESOLVED FIXED
Alias: None
Product: guibuilder
Classification: Unclassified
Component: Code (show other bugs)
Version: 3.x
Hardware: PC All
: P4 blocker (vote)
Assignee: issues@guibuilder
URL:
Keywords:
: 32356 38839 40201 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-11-13 10:15 UTC by pzajac
Modified: 2007-11-28 14:06 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
exception stacktrace (2.42 KB, text/plain)
2003-11-13 10:16 UTC, pzajac
Details
error dialog (14.68 KB, image/jpeg)
2003-11-13 15:59 UTC, Tomas Pavek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description pzajac 2003-11-13 10:15:44 UTC
[200311130740]
Steps to reproduction:
----------------------
1)Delete ColorPreview class from example.
2)Open ColorPicker

ClassNotFoundException thrown because ColorPicker
form uses ColorPreview component.
Comment 1 pzajac 2003-11-13 10:16:39 UTC
Created attachment 12138 [details]
exception stacktrace
Comment 2 Tomas Pavek 2003-11-13 10:39:32 UTC
Form editor correctly reports that component class cannot be loaded,
which is IMHO quite understandable if you delete the class. Why do you
think it is a bug?
Comment 3 pzajac 2003-11-13 13:17:05 UTC
at least the exception is not annotated. On opening form there should
be better to show user friendly message instead.
Comment 4 Tomas Pavek 2003-11-13 15:58:39 UTC
The exception is annotated. When I try it I get a dialog explaining
what happened. See attachment. It is not friendly?
Comment 5 Tomas Pavek 2003-11-13 15:59:31 UTC
Created attachment 12150 [details]
error dialog
Comment 6 Tomas Pavek 2003-11-18 18:29:36 UTC
Still not convinced this is a bug...
Comment 7 Jan Chalupa 2003-11-19 09:00:12 UTC
I tend to agree with Petr.

First, the title of the dialog box says "Exception" which is not very
helpful.

Second, the message text says "component could not be loaded" three
times (!) in different words, but it doesn't provide any hint why.

Third, the exception stack-trace shown after the Show Details button
is pressed, doesn't help the user either.

I understand this is rather a general problem and there are other
examples like this in the IDE. However, it doesn't make this a
non-issue. P3 -> P4.
Comment 8 Tomas Pavek 2003-11-19 18:37:40 UTC
To be honest, your comments are not much helpful either ;) I know what
you don't like, but don't know how it should behave correctly then.
Let's look at it more closely.

> First, the title of the dialog box says "Exception" which is not very
> helpful.

Well, this is in fact a problem of user component - its class cannot
be found. So it is basically problem in user data (or code), not in
form editor code. So it is an exception. Hidding this fact from the
user does not make sense.

> Second, the message text says "component could not be loaded" three
> times (!) in different words, but it doesn't provide any hint why.

The best hint you can give to the user about her code is to give her
the exception as the root cause of the problem. It is IMO most helpful
for a developer. Form editor might provide intelligent messages based
on type of exception and conditions when it happanes, but IMHO this is
not the problem in current state (saying "class cannot be loaded" for
ClassNotFoundException should be enough). The only ugly thing is the
last repeating of the "Component cannot be loaded". Instead, we could
provide a advice like "Check if the class is compiled and available in
mounted filesystems." That can be done. But the rest is IMO OK. If you
don't agree, please consult this with HIE.
Comment 9 pzajac 2003-11-19 19:11:21 UTC
I strongly disagree with your IMHO. The developer of form, jdialog is
user of netbeans. At first sight the exception looks like bug in
netbeans. The exception is writen to ide.log like error. Can you tell
  me which line of stacktrace is so important for user? IMHO for java
beginner it must be very dificult to understand to this stacktrace. 

Let's me show you other example:
User tried to delete java file  in filesystem. Are you really sure
that  it is  good idea to show exception if file is read only?  IMHO not. 
Comment 10 Jan Chalupa 2003-11-19 21:14:29 UTC
I agree with Petr's first paragraph. It looks like a bug in the IDE
which it is not. Then the IDE should not provide the user with an
exception (moreover logged into ide.log), but rather with an error
message followed by the useful hint such as the one proposed by Tomas.

Although I agree with Petr's second paragraph too, it is not a form
module issue, so let's not discuss it here.
Comment 11 Tomas Pavek 2003-11-20 09:18:50 UTC
Okay, I see your point - the user might be confused by "Exception"
title. What is the right title then? Warning? Ccing Dusan for advise.
Comment 12 dpavlica 2003-11-20 10:36:02 UTC
It seems to me, that Error dialog will solve this issue. And mentioned
 text "Check if the class is compiled and available in mounted
filesystems." could be used too.

For guideline check this link:
http://java.sun.com/products/jlf/ed2/book/HIG.Dialogs5.html#35722
Comment 13 Tomas Pavek 2004-02-20 15:35:18 UTC
*** Issue 40201 has been marked as a duplicate of this issue. ***
Comment 14 Tomas Pavek 2004-02-22 14:14:25 UTC
*** Issue 38839 has been marked as a duplicate of this issue. ***
Comment 15 Tomas Pavek 2005-08-29 10:02:29 UTC
*** Issue 32356 has been marked as a duplicate of this issue. ***
Comment 16 Jan Stola 2007-11-28 14:06:27 UTC
Error handling was changed in the last few relases => closing as fixed.