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.
Build: NetBeans IDE 6.0 Beta 1 (Build 200709101200) VM: Java HotSpot(TM) Client VM, 1.6.0-b105 OS: Windows XP, 5.1, x86 User Comments:
Created attachment 50696 [details] stacktrace
I am sorry, it is not possible to track the problem down only from the stack trace of the exception. Could you, please, provide more information? It would be ideal to attach the corresponding .form and .java files (saved in the last good state) and describe the exact steps that lead to this exception.
No additional information provided => closing as WORKSFORME.
Changing resolution to WORKSFORME.
Reopening - reproduced in NetBeans IDE Dev (Build 200810140201) http://statistics.netbeans.org/exceptions/detail.do?id=133867
StackTrace: =========== java.lang.NullPointerException at org.netbeans.modules.form.layoutdesign.LayoutModel.removeInterval(LayoutModel.java:301) at org.netbeans.modules.form.layoutdesign.LayoutDesigner.intervalRemoved(LayoutDesigner.java:3736) at org.netbeans.modules.form.layoutdesign.LayoutDesigner.layoutChanged(LayoutDesigner.java:2184) at org.netbeans.modules.form.layoutdesign.LayoutDesigner.access$100(LayoutDesigner.java:35) at org.netbeans.modules.form.layoutdesign.LayoutDesigner$Listener.layoutChanged(LayoutDesigner.java:2150)
Any steps to reproduce?
No additional info provided since the last reopening -> closing again as worksforme
Sorry, I accidentally set this to FIXED. Reopening ...
... and setting the resolution to: WORKSFORME
Hi, I encountered this on NB 6.5 with latest updates as of date of filling this comment. The root cause is some bad xml from the xxx.form file (note duplicated elements): i.e: ------------- sample from the file when this ocurs ---- <Group type="103" groupAlignment="0" attributes="0"> <Component id="jButtonRecordClippp" max="32767" attributes="1"/> <Component id="jButtonRecordClippp" max="32767" attributes="1"/> </Group> ------------------------ I have no idea how this gets into the xxx.form , maybe some bugs in code that syncs the xml . As I can remember I was trying to move the button in a jpannel when the problem started to show up. Thanks. Andrei.
Hi , Please note that fixing content of xml in xxx.form makes this exception not showing again. I actually edited the content of form file with an external editor and removed the duplicate element, reopened the form in netbeans and all works again. Thanks.
Please, let us know if you find a reproducible test case showing how the duplicate elements can be created.
Hi, I have submitted before my initial comments on this issue some usage data , not sure if they helps but www.netbeans.org pointed to this issue as fix for the usage data . Meanwhile I will keep my eyes open to identify a test case. Thanks, Andrei.
Hi , I think one shall look into the code that ads components into a group so that there are no duplicate items in that group and put there a stack trace so that the problem can be further traced . It seems to randomly occur but all the cases I encountered until now leads to bad xml code with duplicate items , therefore stacktracing when this duplicate items ocurs may add more details for the problem. Hope this helps. Thanks, Andrei
Build: NetBeans IDE 6.7 (Build 200906241340) VM: Java HotSpot(TM) Client VM, 14.0-b16, Java(TM) SE Runtime Environment, 1.6.0_14-b08 OS: Linux, 2.6.27-14-generic, i386 User Comments: Moving 'dataDesembaraco6' for any place at form. I will attach the sample soon. Stacktrace: java.lang.NullPointerException<br/> at org.netbeans.modules.form.layoutdesign.LayoutModel.removeInterval(LayoutModel.java:334)<br/> at org.netbeans.modules.form.layoutdesign.LayoutDesigner.intervalRemoved(LayoutDesigner.java:3884)<br/> at org.netbeans.modules.form.layoutdesign.LayoutDesigner.layoutChanged(LayoutDesigner.java:2283)<br/> at org.netbeans.modules.form.layoutdesign.LayoutDesigner.access$100(LayoutDesigner.java:58)<br/> at org.netbeans.modules.form.layoutdesign.LayoutDesigner$Listener.layoutChanged(LayoutDesigner.java:2249)<br/> at org.netbeans.modules.form.layoutdesign.LayoutModel.fireEvent(LayoutModel.java:805)<br/>
Created attachment 84751 [details] stacktrace
This issue already has 50 duplicates see http://statistics.netbeans.org/exceptions/detail.do?id=7256
Created attachment 84752 [details] Form sample for NPE
The recent added attachments reveals same problem as I saw : bad xml in form that triggers it: <Group type="103" groupAlignment="0" attributes="0"> <Component id="dataDesembaraco6" alignment="0" min="-2" max="-2" attributes="0"/> <Component id="dataDesembaraco6" alignment="0" min="-2" max="-2" attributes="0"/> </Group> Netbeans please add stack trace when duplicates occurs, so that we can easy find the steps to reproduce. Thanks. P.S: It looks this floats around from 6.0 ? !!! So it is a tough one !
Thanks to sandi_ro for evaluation and to hmichel for a test-case. I have added a check for a duplicate insertion of the same component into one layout interval. IllegalArgumentException is thrown when this happens. This should allow us to track the original defect. The annoying side effect of this change is that forms that already contain the duplicate components cannot by opened - the mentioned IllegalArgumentException is throw when you attempt to open them. The workaround is either to remove the duplicate definition from the .form file manually (as sandi_ro suggested) or to start NetBeans with netbeans.ignore.issue118562 system property set to anything non-null. This will force the insertion code to ignore the duplicit component and continue without exception being thrown. I am closing this issue as fixed because it is about an exception that is a consequence of the original problem. The original problem will appear in the issue/exception database under a different stack trace. Feel free to reopen this issue if you find a different cause of this exception. Modified file: http://hg.netbeans.org/cdev/rev/415cbabaebb5
Thank you for adding code to throw exception .
Could you please try to insert into exception the component name? It should make easier to find the problematic component when opening an "old" form. Something like 'Cannot add a component 'XYZ' into a group twice!' Thanks.
> Could you please try to insert into exception the component name? I was considering that, but I cannot do that unfortunately. The corresponding code identifies the component by some internal ID and the mapping between the IDs and component names is not accessible at that place.