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 Dev (Build 20120523-da4743d1f776) VM: Java HotSpot(TM) Client VM, 23.0-b21, Java(TM) SE Runtime Environment, 1.7.0_04-b20 OS: Linux User Comments: hmichel: Opening a form Stacktrace: java.lang.NullPointerException at org.netbeans.modules.form.FormDesigner.pointFromHandleToComponentLayer(FormDesigner.java:773) at org.netbeans.modules.form.HandleLayer.convertPointToComponent(HandleLayer.java:1811) at org.netbeans.modules.form.HandleLayer.checkLayoutResizing(HandleLayer.java:1546) at org.netbeans.modules.form.HandleLayer.checkResizing(HandleLayer.java:1467) at org.netbeans.modules.form.HandleLayer.mouseMoved(HandleLayer.java:2110) at java.awt.Component.processMouseMotionEvent(Component.java:6550)
Created attachment 119817 [details] stacktrace
Can you attach the form where this happened, or was it random?
It is not random at build 20120523-da4743d1f776. I will try to attach a sample to you soon, since the panel I am facing it has some dependencies that I need to eliminate to make possible to you test it without our entire project.
Correcting my last statement, actually it is kind of random. I am trying to create exactly steps to reproduce it, but looks like it just happen in certain conditions I am not sure yet, but looks related to libraries loading order or something like that.
Created attachment 119839 [details] stacktrace
Created attachment 119840 [details] Test case To reproduce it, follow the steps: 1. Open the attached project and the design view for Test212953.java; 2. Restart the IDE with the design view for Test212953.java opened; 3. When you move the mouse cursor over the designer the exception should appear to you. I have seen that another exceptions are present at the log file, but those are not shown by exception reporter but I am pretty sure that is the cause. i was able to reproduce it with the follow environment, using a clean user dir without importing previous settings: Product Version: NetBeans IDE Dev (Build 20120523-da4743d1f776) Java: 1.7.0_04; Java HotSpot(TM) Client VM 23.0-b21 System: Linux version 3.0.0-17-generic-pae running on i386; UTF-8; en_US (nb) User directory: /home/mgraciano/.netbeans/dev_212953 Cache directory: /home/mgraciano/.cache/netbeans/dev_212953
BTW, I was able to reproduce it just when my form extends JXTaskPane, which is the exactly case at my production project.
I was able to reproduce it according to the steps, does not happen always, but very often. The problem is the first exception: java.lang.NullPointerException at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:169) at org.jdesktop.swingx.plaf.LookAndFeelAddons.getUI(LookAndFeelAddons.java:280) at org.jdesktop.swingx.JXTaskPane.updateUI(JXTaskPane.java:239) at org.jdesktop.swingx.JXTaskPane.<init>(JXTaskPane.java:201) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at java.lang.Class.newInstance0(Class.java:355) at java.lang.Class.newInstance(Class.java:308) at org.netbeans.modules.form.CreationFactory.createDefaultInstance(CreationFactory.java:178) at org.netbeans.modules.form.RADComponent.createBeanInstance(RADComponent.java:252) [catch] at org.netbeans.modules.form.RADComponent.cloneBeanInstance(RADComponent.java:412) at org.netbeans.modules.form.VisualReplicator.cloneComponent(VisualReplicator.java:696) at org.netbeans.modules.form.VisualReplicator.createClone(VisualReplicator.java:181) at org.netbeans.modules.form.VisualReplicator.createClone(VisualReplicator.java:169) at org.netbeans.modules.form.FormDesigner$FormListener.run(FormDesigner.java:2482) at org.netbeans.modules.form.FormLAF$3.run(FormLAF.java:322) at org.openide.util.Mutex.doEventAccess(Mutex.java:1363) at org.openide.util.Mutex.readAccess(Mutex.java:273) at org.netbeans.modules.form.FormLAF.executeWithLookAndFeel(FormLAF.java:305) at org.netbeans.modules.form.FormDesigner$FormListener.processEvents(FormDesigner.java:2464) at org.netbeans.modules.form.FormDesigner$FormListener.formChanged(FormDesigner.java:2430) at org.netbeans.modules.form.FormDesigner.updateWholeDesigner(FormDesigner.java:617) at org.netbeans.modules.form.FormDesigner.initialize(FormDesigner.java:270) at org.netbeans.modules.form.FormDesigner.loadingComplete(FormDesigner.java:1958) at org.netbeans.modules.nbform.FormDesignerTC.loadForm(FormDesignerTC.java:276) at org.netbeans.modules.nbform.FormDesignerTC.access$300(FormDesignerTC.java:86) at org.netbeans.modules.nbform.FormDesignerTC$PreLoadTask$1.run(FormDesignerTC.java:263) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:641) at java.awt.EventQueue.access$000(EventQueue.java:84) at java.awt.EventQueue$1.run(EventQueue.java:602) at java.awt.EventQueue$1.run(EventQueue.java:600) at java.security.AccessController.doPrivileged(Native Method) at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87) at java.awt.EventQueue.dispatchEvent(EventQueue.java:611) at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:158) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161) at java.awt.EventDispatchThread.run(EventDispatchThread.java:122) Instantiation of org.jdesktop.swingx.JXTaskPane fails due to missing "swingx/TaskPaneUI" value in UIManager (should be the UI class name for the component). It is the instance for the design view that fails, the instance held in the model is created fine before that. If this happens, the design view is completely broken, the form must be closed and opened again (then it works).
You marked the Tm as Next, I really hope it could be fixed for 7.2, mainly because it is a regression and can affect a lot of users.
*** Bug 213575 has been marked as a duplicate of this bug. ***
Bug 213575 shows the same thing, just the SwingX components are used on the form, but the form itself is not a SwingX component. The same failure (cloning SwingX component) can also be seen in bug 212751, where also plain JFileChooser seems to be broken (FileChooserUI not found UIManager).
(In reply to comment #9) > You marked the Tm as Next, I really hope it could be fixed for 7.2, mainly > because it is a regression and can affect a lot of users. If this is regression, it should be marked P1 should it not?
(In reply to comment #12) > If this is regression, it should be marked P1 should it not? IMHO, it should be, at least a P2 [1]. [1] http://wiki.netbeans.org/BugPriorityGuidelines
Why do you think it is a regression? The log from bug 212751 contains the same exception that happened in 7.0. java.lang.NullPointerException at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:169) at org.jdesktop.swingx.plaf.LookAndFeelAddons.getUI(LookAndFeelAddons.java:303) at org.jdesktop.swingx.calendar.JXMonthView.updateUI(JXMonthView.java:305) at org.jdesktop.swingx.calendar.JXMonthView.<init>(JXMonthView.java:261) ... Is it happening more often now?
(In reply to comment #14) > Why do you think it is a regression? The log from bug 212751 contains the same > exception that happened in 7.0. > > java.lang.NullPointerException > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:169) > at > org.jdesktop.swingx.plaf.LookAndFeelAddons.getUI(LookAndFeelAddons.java:303) > at org.jdesktop.swingx.calendar.JXMonthView.updateUI(JXMonthView.java:305) > at org.jdesktop.swingx.calendar.JXMonthView.<init>(JXMonthView.java:261) > ... > > Is it happening more often now? I don't have this problem before 7.2. All my forms which match with this scenario can be opened without any problem before 7.2, and now this problem happens very often.
Sorry, but I can't use 7.2 for several forms we have at our project, and this forms are OK at 7.X. It is a stopper for 7.2 and my team will not be able to migrate to 7.2 because this issue.
As Tomas wrote already, the exception shows that there is missing "swingx/TaskPaneUI" key in UIDefaults. We perform some complex magic with UIDefaults. This magic is to blame. The goal of this magic is (among others) to provide the default (=unmodified) UIDefaults to the designed form despite modifications done by NetBeans IDE (to implement its UI tweaks). Due to the nature of UIDefaults and the way it is handled by custom Swing components, this functionality cannot be absolutely reliable. That's why exceptions like this can be found even in older builds/releases of NetBeans. Unfortunately, it seems that for NB 7.2 we made a change that made these problems more frequent. The culprit seems to be the fix of issue 207413. FormClassLoader is held too weakly after this change. In fact, debugging of the attached test-case shows that this classloader is garbage collected during opening of the form. Hence, a new classloader is created which breaks classloader-sensitive part of UIDefault magic. We should make sure that FormClassLoader is held strongly until the form is closed.
I've made a fix which should eliminate this problem due to the class loader dropped out of the cache. Integrated into main. http://hg.netbeans.org/jet-main/rev/a2f8994a7d18 Please test and verify once nightly build is available.
As soon as it hits the main repo I will rebuild my IDE and test it for sure. Thanks a lot.
Target Milestone should be set to 7.3 until the fix is merged into release72 branch, see http://wiki.netbeans.org/NetBeans_72_HighResistance
(In reply to comment #20) > Target Milestone should be set to 7.3 until the fix is merged into release72 > branch, see http://wiki.netbeans.org/NetBeans_72_HighResistance Thanks for pointing me this, I was unaware of it.
Definitely I can't reproduce it anymore. I tried hard but I just couldn't. Thanks for the fix. v. NetBeans IDE Dev (Build 20120620-c587ba686a6a)
I have reviewed the fix. It seems to be correct and safe for integration into NB 7.2.
http://hg.netbeans.org/releases/rev/477b5ddf3bf5
Integrated into 'releases', will be available in build *201206212341* or newer. Wait for official and publicly available build. Changeset: http://hg.netbeans.org/releases/rev/477b5ddf3bf5 User: Tomas Pavek <tpavek@netbeans.org> Log: #212953: need to keep the same project classloader instance during the opened form lifetime (the classloader cache was too "weak")
Integrated into 'main-golden', will be available in build *201206220002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/a2f8994a7d18 User: Tomas Pavek <tpavek@netbeans.org> Log: #212953: need to keep the same project classloader instance during the opened form lifetime (the classloader cache was too "weak")
... pending verification in NB 7.2
I am not able to reproduce this bug with: Product Version: NetBeans IDE 7.2 RC1 (Build 201206242201) Java: 1.7.0_06-ea; Java HotSpot(TM) Client VM 23.2-b05 System: Linux version 3.2.0-25-generic-pae running on i386; UTF-8; en_US (nb) I think it would be fine if Michel verifies this bug too in 72branch. So I leave the status of this bug as RESOLVED, until 72 build becomes public (it should happen this weak) and Michel add his comment.
Product Version: NetBeans IDE 7.2 (Build 201206291011) Java: 1.7.0_05; Java HotSpot(TM) Client VM 23.1-b03 System: Linux version 3.0.0-17-generic-pae running on i386; UTF-8; en_US (nb)