cornercorner
FeaturesPluginsDocs & SupportCommunityPartners

Bug 165925 - NullPointerException at org.netbeans.modules.profiler.actions.ProfilerToolbarDropdownAction.getToolbarPresenter
: NullPointerException at org.netbeans.modules.profiler.actions.ProfilerToolbar...
Status: VERIFIED FIXED
: profiler
Base
: 6.7
: All All
: P1 (vote)
: 6.7
Assigned To:
:
: http://statistics.netbeans.org/except...
: EXCEPTIONS_REPORT
: 67_HR_FIX, RANDOM, REGRESSION
:
:
  Show dependency treegraph
 
Reported: 2009-05-25 09:39 by
Modified: 2009-05-29 15:07 (History)
Issue Type: DEFECT
:


Attachments
stacktrace (3.92 KB, text/plain)
2009-05-25 09:40, Vojtech Sigler
Details
I am not able to reproduce the problem, but this patch provides fallback which might help (1.70 KB, patch)
2009-05-25 12:33, Jaroslav Tulach
Details | Diff
stacktrace (3.91 KB, text/plain)
2009-05-25 15:22, swpalmer
Details
stacktrace (3.91 KB, text/plain)
2009-05-25 16:11, Filip Zamboj
Details
An improved patch to guarantee that there is at most one AttachAction instance created (3.73 KB, patch)
2009-05-26 12:56, Jaroslav Tulach
Details | Diff
ProfilerToolbarDropdownAction.java (6.75 KB, text/plain)
2009-05-26 15:54, Jiri Sedlacek
Details
messages_OK.log (29.51 KB, text/plain)
2009-05-26 15:55, Jiri Sedlacek
Details
messages_NPE.log (41.11 KB, text/plain)
2009-05-26 15:55, Jiri Sedlacek
Details
NPE was caused by missing NAME attribute. Added. Please give the new patch a try. Thanks. (3.84 KB, patch)
2009-05-27 11:07, Jaroslav Tulach
Details | Diff
stacktrace (3.92 KB, text/plain)
2009-05-27 15:47, cbulcu
Details


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2009-05-25 09:39:59
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)
------- Comment #1 From 2009-05-25 09:40:04 -------
Created an attachment (id=82721) [details]
stacktrace
------- Comment #2 From 2009-05-25 10:48:11 -------
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 ???
------- Comment #3 From 2009-05-25 10:51:42 -------
RC1 build (NetBeans IDE 6.7 RC1 (Build 200905232021)) is affected by this bug
as well.
------- Comment #4 From 2009-05-25 12:33:52 -------
Created an attachment (id=82730) [details]
I am not able to reproduce the problem, but this patch provides fallback which
might help
------- Comment #5 From 2009-05-25 15:22:08 -------
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)
------- Comment #6 From 2009-05-25 15:22:31 -------
Created an attachment (id=82742) [details]
stacktrace
------- Comment #7 From 2009-05-25 16:11:12 -------
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)
------- Comment #8 From 2009-05-25 16:11:22 -------
Created an attachment (id=82747) [details]
stacktrace
------- Comment #9 From 2009-05-25 16:30:50 -------
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
------- Comment #10 From 2009-05-25 17:06:31 -------
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".
------- Comment #11 From 2009-05-26 12:56:03 -------
Created an attachment (id=82794) [details]
An improved patch to guarantee that there is at most one AttachAction instance
created
------- Comment #12 From 2009-05-26 12:57:39 -------
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.
------- Comment #13 From 2009-05-26 14:58:53 -------
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.
------- Comment #14 From 2009-05-26 14:59:33 -------
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)
------- Comment #15 From 2009-05-26 15:54:02 -------
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.
------- Comment #16 From 2009-05-26 15:54:42 -------
Created an attachment (id=82810) [details]
ProfilerToolbarDropdownAction.java
------- Comment #17 From 2009-05-26 15:55:19 -------
Created an attachment (id=82811) [details]
messages_OK.log
------- Comment #18 From 2009-05-26 15:55:41 -------
Created an attachment (id=82812) [details]
messages_NPE.log
------- Comment #19 From 2009-05-27 11:07:23 -------
Created an attachment (id=82848) [details]
NPE was caused by missing NAME attribute. Added. Please give the new patch a
try. Thanks.
------- Comment #20 From 2009-05-27 12:40:43 -------
Jardo/Jirka ... do you plan to fix that for 6.7 ?
------- Comment #21 From 2009-05-27 13:00:56 -------
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.
------- Comment #22 From 2009-05-27 13:06:33 -------
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).
------- Comment #23 From 2009-05-27 14:44:04 -------
ergonomics#a4024676ce56

I think this is candidate for backporting to release67 clone.
------- Comment #24 From 2009-05-27 15:47:27 -------
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)
------- Comment #25 From 2009-05-27 15:47:31 -------
Created an attachment (id=82868) [details]
stacktrace
------- Comment #26 From 2009-05-27 16:55:07 -------
Ok, so let's start with HR process.
------- Comment #27 From 2009-05-28 09:27:21 -------
a4024676ce56
------- Comment #28 From 2009-05-28 18:45:11 -------
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
------- Comment #29 From 2009-05-29 15:07:44 -------
Verified in RC1 (Build 200905282243)