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 200905250201) VM: Java HotSpot(TM) Client VM, 11.3-b02, Java(TM) SE Runtime Environment, 1.6.0_13-b03 OS: Linux, 2.6.28-11-generic, i386 User Comments: vsigler: Started netbeans with a clean userdir and opened a java project. Stacktrace: java.lang.NullPointerException at org.netbeans.modules.profiler.actions.ProfilerToolbarDropdownAction.getToolbarPresenter(ProfilerToolbarDropdownAction.java:89) at org.openide.awt.Toolbar$Folder.createInstance(Toolbar.java:417) at org.openide.loaders.FolderInstance.defaultProcessObjectsFinal(FolderInstance.java:857) at org.openide.loaders.FolderInstance$1R.run(FolderInstance.java:722) at org.openide.util.Task.run(Task.java:249) at org.netbeans.modules.openide.loaders.AWTTask.run(AWTTask.java:70)
Created attachment 82721 [details] stacktrace
Product Version: NetBeans IDE Dev (Build 200905250201) Java: 1.6.0_13; Java HotSpot(TM) Client VM 11.3-b02 System: Windows Vista version 6.0 running on x86; Cp1252; en_US (nb) Reproduced - downloaded OS independent zip of "All" IDE, started with a clean userdir an opened an existing Java SE project. Exception is thrown when "Activating Java SE". I assume ERGONOMICS is involved. REGRESSION, used to work in Beta. Caused by http://hg.netbeans.org/profiler-main/rev/e0534204438f ???
RC1 build (NetBeans IDE 6.7 RC1 (Build 200905232021)) is affected by this bug as well.
Created attachment 82730 [details] I am not able to reproduce the problem, but this patch provides fallback which might help
Build: NetBeans IDE Dev (Build 200905250201) VM: Java HotSpot(TM) Client VM, 11.3-b02, Java(TM) SE Runtime Environment, 1.6.0_13-b03 OS: Windows XP, 5.1, x86 User Comments: Opened a JavaSE project on fist launch after install. Using a fresh user dir (no settings copied from 6.5, previous dev dir removed when uninstalling the previous build) Stacktrace: java.lang.NullPointerException at org.netbeans.modules.profiler.actions.ProfilerToolbarDropdownAction.getToolbarPresenter(ProfilerToolbarDropdownAction.java:89) at org.openide.awt.Toolbar$Folder.createInstance(Toolbar.java:417) at org.openide.loaders.FolderInstance.defaultProcessObjectsFinal(FolderInstance.java:857) at org.openide.loaders.FolderInstance$1R.run(FolderInstance.java:722) at org.openide.util.Task.run(Task.java:249) at org.netbeans.modules.openide.loaders.AWTTask.run(AWTTask.java:70)
Created attachment 82742 [details] stacktrace
Build: NetBeans IDE Dev (Build 090525) VM: Java HotSpot(TM) 64-Bit Server VM, 11.3-b02, Java(TM) SE Runtime Environment, 1.6.0_13-b03 OS: Linux, 2.6.28-11-generic, amd64 User Comments: Stacktrace: java.lang.NullPointerException at org.netbeans.modules.profiler.actions.ProfilerToolbarDropdownAction.getToolbarPresenter(ProfilerToolbarDropdownAction.java:89) at org.openide.awt.Toolbar$Folder.createInstance(Toolbar.java:417) at org.openide.loaders.FolderInstance.defaultProcessObjectsFinal(FolderInstance.java:857) at org.openide.loaders.FolderInstance$1R.run(FolderInstance.java:722) at org.openide.util.Task.run(Task.java:249) at org.netbeans.modules.openide.loaders.AWTTask.run(AWTTask.java:70)
Created attachment 82747 [details] stacktrace
Who will test my patch[1] and verify that it fixes the problem? [1] http://www.netbeans.org/nonav/issues/showattachment.cgi/82730/X.diff
I can't reproduce the problem using a trunk devbuild, I don't know how to activate the Ergonomics IDE. When I launch my IDE, it immediately starts with populated toolbar and doesn't lazily enable Java SE when opening the project. Note that you've removed the ERGONOMICS keyword but this bug only appears when the Java SE feature is being lazily enabled when opening a Java SE project for the first time. If the bug is not reproducible in your/latest devbuild, I think you should still find the cause and not just close the issue as WORKSFORME - it could be just temporarily hidden by a race condition... Regarding your patch - does it ensure that just one AttachAction instance will be created? Without knowing how that layers/filesystems stuff works I'm afraid that the code creates one action instance and eventually the framework creates second one when processing "Actions/Profile/org-netbeans-modules-profiler-actions-AttachAction.instance".
Created attachment 82794 [details] An improved patch to guarantee that there is at most one AttachAction instance created
Anyone who can see the old, broken behaviour, please give my latest patch a try. I am not able to do anything otherwise, as I have not yet seen this failure myself.
Reopening, still happens in a devbuild. When a Java SE project is being opened shortly after the initial 'Scanning projects' the 'FileUtil.getConfigFile("Actions/Profile/org-netbeans-modules-profiler-actions-AttachAction.instance")' call returns 'null' in about 50% cases.
The patch doesn't work correctly, it causes another NPE: java.lang.NullPointerException at org.openide.awt.Actions.cutAmpersand(Actions.java:355) at org.netbeans.modules.profiler.actions.ProfilerToolbarDropdownAction.createDropdownItem(ProfilerToolbarDropdownAction.java:146) at org.netbeans.modules.profiler.actions.ProfilerToolbarDropdownAction.getToolbarPresenter(ProfilerToolbarDropdownAction.java:99) at org.openide.awt.Toolbar$Folder.createInstance(Toolbar.java:417) at org.openide.loaders.FolderInstance.defaultProcessObjectsFinal(FolderInstance.java:857) at org.openide.loaders.FolderInstance$1R.run(FolderInstance.java:722) at org.openide.util.Task.run(Task.java:249) at org.netbeans.modules.openide.loaders.AWTTask.run(AWTTask.java:70) [catch] at org.netbeans.modules.openide.loaders.AWTTask$Processor.run(AWTTask.java:111) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209) at java.awt.EventQueue.dispatchEvent(EventQueue.java:597) at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:104) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:178) at java.awt.Dialog$1.run(Dialog.java:1051) at java.awt.Dialog$3.run(Dialog.java:1103) at java.security.AccessController.doPrivileged(Native Method) at java.awt.Dialog.show(Dialog.java:1101) at java.awt.Component.show(Component.java:1516) at java.awt.Component.setVisible(Component.java:1468) at java.awt.Window.setVisible(Window.java:841) at java.awt.Dialog.setVisible(Dialog.java:991) at org.netbeans.modules.project.ui.OpenProjectList.open(OpenProjectList.java:574) at org.netbeans.modules.project.ui.actions.OpenProject.actionPerformed(OpenProject.java:144) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236) at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:273) at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272) at java.awt.Component.processMouseEvent(Component.java:6216) at javax.swing.JComponent.processMouseEvent(JComponent.java:3265) at java.awt.Component.processEvent(Component.java:5981) at java.awt.Container.processEvent(Container.java:2041) at java.awt.Component.dispatchEventImpl(Component.java:4583) at java.awt.Container.dispatchEventImpl(Container.java:2099) at java.awt.Component.dispatchEvent(Component.java:4413) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4556) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4220) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4150) at java.awt.Container.dispatchEventImpl(Container.java:2085) at java.awt.Window.dispatchEventImpl(Window.java:2475) at java.awt.Component.dispatchEvent(Component.java:4413) at java.awt.EventQueue.dispatchEvent(EventQueue.java:599) at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:104) 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)
I've modified the ProfilerToolbarDropdownAction.java to produce debug thread dumps and outputs to better debug what's happening when the NPE is thrown. In case when the NPE occurs the ProfilerToolbarDropdownAction.getToolbarPresenter() implementation (toolbarPresenter == null) is called twice, whereas for no exception this code is called just once. The modified ProfilerToolbarDropdownAction.java and two IDE logs (successful + with NPE) are attached.
Created attachment 82810 [details] ProfilerToolbarDropdownAction.java
Created attachment 82811 [details] messages_OK.log
Created attachment 82812 [details] messages_NPE.log
Created attachment 82848 [details] NPE was caused by missing NAME attribute. Added. Please give the new patch a try. Thanks.
Jardo/Jirka ... do you plan to fix that for 6.7 ?
I'd like to put a workaround that will prevent this NPE to release67 as soon as Jirka confirms that my patch eliminates the problem.
I can confirm that the patch workarounds the described problem. Jardo, please add the assert to not mask the real bug and add "// NOI18N" comment to ProfilerToolbarDropdownAction.java:90 (after applying the patch).
ergonomics#a4024676ce56 I think this is candidate for backporting to release67 clone.
Build: NetBeans IDE Dev (Build 200905270201) VM: Java HotSpot(TM) Client VM, 11.3-b02, Java(TM) SE Runtime Environment, 1.6.0_13-b03 OS: Windows Vista, 6.1, x86 User Comments: Opened the first project, after starting NB the very first time, after installation Stacktrace: java.lang.NullPointerException at org.netbeans.modules.profiler.actions.ProfilerToolbarDropdownAction.getToolbarPresenter(ProfilerToolbarDropdownAction.java:89) at org.openide.awt.Toolbar$Folder.createInstance(Toolbar.java:417) at org.openide.loaders.FolderInstance.defaultProcessObjectsFinal(FolderInstance.java:857) at org.openide.loaders.FolderInstance$1R.run(FolderInstance.java:722) at org.openide.util.Task.run(Task.java:249) at org.netbeans.modules.openide.loaders.AWTTask.run(AWTTask.java:70)
Created attachment 82868 [details] stacktrace
Ok, so let's start with HR process.
a4024676ce56
Integrated into 'main-golden', will be available in build *200905281401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/a4024676ce56 User: Jaroslav Tulach <jtulach@netbeans.org> Log: #165925: Workarounding the fact that sometimes an action defined in layer of its own module may not be visible while the module is being activated. Deserves more investigation and proper fix elsewhere, so I am leaving an assert there, which will make the code fail in development versions of the IDE
Verified in RC1 (Build 200905282243)