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.
Development 200606261800 of NetBeans dev (6.0) JDK 1.6.0, VM b84 Description: ============ Create project with jFrame. Then Click on button "Choose Bean" which is on Palette in section Beans. If you set wrong class name and confirm it then a lot of exception will occure. StackTrace: =========== java.lang.IllegalStateException: Can't overwrite cause at java.lang.Throwable.initCause(Throwable.java:320) at org.openide.ErrorManager$AnnException.findOrCreate(ErrorManager.java:838) at org.openide.ErrorManager$DelegatingErrorManager.annotate(ErrorManager.java:623) at org.openide.ErrorManager.annotate(ErrorManager.java:423)
Created attachment 31422 [details] 79227
It seems to be a problem of ErrorManager. It is not able to annotate ClassNotFoundException. It calls initCause() on CNFE, but CNFE refuses such a call. See also issue 79015 and revision 1.5 of Exceptions class for a similar problem.
Yarda, please look at this.
Checking in src/org/openide/ErrorManager.java; /shared/data/ccvs/repository/openide/util/src/org/openide/ErrorManager.java,v <-- ErrorManager.java new revision: 1.10; previous revision: 1.9 done Checking in test/unit/src/org/openide/ErrorManagerDelegatesToLoggingTest.java; /shared/data/ccvs/repository/openide/util/test/unit/src/org/openide/ErrorManagerDelegatesToLoggingTest.java,v <-- ErrorManagerDelegatesToLoggingTest.java new revision: 1.5; previous revision: 1.4
The behaviour is different by now, but the ErrorManager still seems to have problem with annotations of CNFE. The mentioned use case leads to the CNFE that is processed in MetaComponentCreator.showClassLoadingErrorMessage(). The exception is annotated and then displayed using USER and INFORMATIONAL levels. Unfortunately a dialog corresponding to EXCEPTION level is displayed and the message shown in the dialog is not the one used in annotation.
Ok, I'll check it tomorrow, but do you guys know that you should replace usage of ErrorManager with Logger as described at: http://www.netbeans.org/download/dev/javadoc/org-openide-util/org/openide/util/doc-files/logging.html
Right, the USER mode did not worked for ClassNotFoundException. Fixed. However think about the usage of Logging, please. /shared/data/ccvs/repository/core/test/unit/src/org/netbeans/core/NbErrorManagerTest.java,v <-- NbErrorManagerTest.java new revision: 1.13; previous revision: 1.12 done Checking in openide/util/src/org/openide/ErrorManager.java; /shared/data/ccvs/repository/openide/util/src/org/openide/ErrorManager.java,v <-- ErrorManager.java new revision: 1.11; previous revision: 1.10
verified on NetBeans IDE Dev (Build 200610261800) 1.6.0-rc; Java HotSpot(TM) Client VM 1.6.0-rc-b99 Windows XP version 5.1 running on x86 cs_CZ (nb); Cp1250 it's OK