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.

Bug 161478 - NPE when clicking on file browser button.
Summary: NPE when clicking on file browser button.
Status: NEW
Alias: None
Product: contrib
Classification: Unclassified
Component: JMX (show other bugs)
Version: 6.x
Hardware: Sun All
: P2 blocker (vote)
Assignee: Jean-francois Denise
URL:
Keywords:
Depends on: 202410
Blocks:
  Show dependency tree
 
Reported: 2009-03-30 15:38 UTC by Jean-francois Denise
Modified: 2011-10-18 20:06 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jean-francois Denise 2009-03-30 15:38:27 UTC
Clicking on the File browser goes for a NPE.
I got it using the File Browser button located in the JMX module (New File/Management properties File)
This is seen on 6.7 M2.
Thanks.

SEVERE [global]
java.lang.NullPointerException
   at org.openide.nodes.Children$Dupl.hashCode(Children.java:1754)
   at java.util.HashMap.get(HashMap.java:300)
   at java.util.Collections$SynchronizedMap.get(Collections.java:1975)
   at org.openide.nodes.EntrySupport$Default.findInfo(EntrySupport.java:269)
   at org.openide.nodes.EntrySupport$Default.justComputeNodes(EntrySupport.java:243)
   at org.openide.nodes.ChildrenArray.nodes(ChildrenArray.java:101)
   at org.openide.nodes.EntrySupport$Default.getNodes(EntrySupport.java:173)
   at org.openide.nodes.EntrySupport$Default.getNodes(EntrySupport.java:219)
   at org.openide.nodes.Children.getNodes(Children.java:440)
   at org.openide.nodes.Children.findChild(Children.java:385)
   at org.openide.nodes.EntrySupport$Default.getNodes(EntrySupport.java:212)
   at org.openide.nodes.Children.getNodes(Children.java:472)
   at org.netbeans.modules.project.ui.BrowseFolders.expandSelection(BrowseFolders.java:209)
   at org.netbeans.modules.project.ui.BrowseFolders.<init>(BrowseFolders.java:107)
   at org.netbeans.modules.project.ui.BrowseFolders.showDialog(BrowseFolders.java:164)
   at org.netbeans.modules.project.ui.SimpleTargetChooserPanelGUI.actionPerformed(SimpleTargetChooserPanelGUI.java:436)
   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.Component.processMouseEvent(Component.java:6237)
   at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
   at java.awt.Component.processEvent(Component.java:6002)
   at java.awt.Container.processEvent(Container.java:2041)
   at java.awt.Component.dispatchEventImpl(Component.java:4604)
   at java.awt.Container.dispatchEventImpl(Container.java:2099)
   at java.awt.Component.dispatchEvent(Component.java:4434)
   at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4574)
   at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
   at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
   at java.awt.Container.dispatchEventImpl(Container.java:2085)
   at java.awt.Window.dispatchEventImpl(Window.java:2475)
   at java.awt.Component.dispatchEvent(Component.java:4434)
   at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
   at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:104)
[catch] 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 org.netbeans.core.windows.services.NbPresenter.superShow(NbPresenter.java:985)
   at org.netbeans.core.windows.services.NbPresenter.doShow(NbPresenter.java:1019)
   at org.netbeans.core.windows.services.NbPresenter.run(NbPresenter.java:1007)
   at org.netbeans.core.windows.services.NbPresenter.run(NbPresenter.java:115)
   at org.openide.util.Mutex.doEventAccess(Mutex.java:1355)
   at org.openide.util.Mutex.readAccess(Mutex.java:268)
   at org.netbeans.core.windows.services.NbPresenter.show(NbPresenter.java:992)
   at java.awt.Component.show(Component.java:1537)
   at java.awt.Component.setVisible(Component.java:1489)
   at java.awt.Window.setVisible(Window.java:841)
   at java.awt.Dialog.setVisible(Dialog.java:991)
   at org.openide.loaders.TemplateWizard.instantiateImpl(TemplateWizard.java:495)
   at org.openide.loaders.TemplateWizard.instantiate(TemplateWizard.java:362)
   at org.netbeans.modules.project.ui.actions.NewFile.doPerform(NewFile.java:154)
   at org.netbeans.modules.project.ui.actions.NewFile.actionPerformed(NewFile.java:126)
   at org.netbeans.modules.project.ui.actions.LookupSensitiveAction.actionPerformed(LookupSensitiveAction.java:161)
   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.AbstractButton.doClick(AbstractButton.java:357)
   at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1225)
   at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1266)
   at java.awt.Component.processMouseEvent(Component.java:6237)
   at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
   at java.awt.Component.processEvent(Component.java:6002)
   at java.awt.Container.processEvent(Container.java:2041)
   at java.awt.Component.dispatchEventImpl(Component.java:4604)
   at java.awt.Container.dispatchEventImpl(Container.java:2099)
   at java.awt.Component.dispatchEvent(Component.java:4434)
   at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4574)
   at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
   at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
   at java.awt.Container.dispatchEventImpl(Container.java:2085)
   at java.awt.Window.dispatchEventImpl(Window.java:2475)
   at java.awt.Component.dispatchEvent(Component.java:4434)
   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 1 Antonin Nebuzelsky 2009-04-02 11:14:00 UTC
Marku, take this one.
Comment 2 mslama 2009-04-02 12:38:02 UTC
Please give exact steps how to reproduce. I do not know what do you mean by 'JMX module' ie. how to invoke that File
browser you talk about. Why is it P2?
Comment 3 mslama 2009-04-02 12:45:10 UTC
In addition NPE happens in nodes so passing there for evaluation.
Comment 4 Jean-francois Denise 2009-04-02 13:23:47 UTC
The JMX module is a stable Module. It is not part of the bundled modules.
Once of the wizards offered by this module allow to generate a properties file. In the first step of this wizard (in New File/JMX/New Management Configuration 
File), a Browse button allows to select a file. Clicking on this button makes the NPE to occur.
Thanks.
JF
 
Comment 5 t_h 2009-04-02 14:36:30 UTC
It seems that null key was supplied to nodes via setKeys(). Nothing to fix in nodes, max. I can check keys and throw NPE
earlier.
Comment 6 mslama 2009-04-02 17:53:47 UTC
Yes Tomas is right. It would be good if null key is invalid value if setKey would throw some Invalid exception directly
so that it is clear. In this case SourceGroup array contains one null element. But I do not know this code and have no
idea who should provide valid value for SimpleTargetChooserPanelGUI. Passing to Milan to help with this.

SimpleTargetChooserPanelGUI.constructor is called with empty folders array ie. its length is 0. Either it is not valid
and it should inform about it or SimpleTargetChooserPanelGUI should handle this better.

Steps to reproduce:
1.First modules jmx, jmx.common, jconsole must be compiled because they are not in build.
2.Then JMX item will appear in New File wizard at first place. Select 'Management Configuration File' on right side and
select Next.
3.Now at second wizard panel initialization is incorrect and pressing Browse button will cause NPE described above.

I will file separate issue for nodes about better diagnostic.
Comment 7 Sandra Lions 2009-04-08 14:35:28 UTC
We have validated the JMX and JConsole modules for NB67.
This issue is the last remaining blocker on our side.

Could you provide a status ?
Comment 8 Jean-francois Denise 2009-04-09 13:35:53 UTC
We noticed that the bug status changed. Is there any progress? Is there any fix to be done on our side? 
Thanks.

JF

Comment 9 Antonin Nebuzelsky 2009-04-09 15:39:06 UTC
Reassigning to Jesse.
Comment 10 Jesse Glick 2009-04-09 20:30:11 UTC
The faulty code is JMXConfigWizardIterator. I am adding better diagnostic exceptions in core-main #72b0d69d1271 so it
will now print:

java.lang.IllegalArgumentException: Attempting to create panel with an empty folders list
        at org.netbeans.modules.project.ui.SimpleTargetChooserPanel.<init>(SimpleTargetChooserPanel.java:76)
        at
org.netbeans.modules.project.ui.ProjectChooserFactoryImpl.createSimpleTargetChooser(ProjectChooserFactoryImpl.java:65)
        at org.netbeans.spi.project.ui.templates.support.Templates.createSimpleTargetChooser(Templates.java:226)
        at org.netbeans.modules.jmx.configwizard.JMXConfigWizardIterator.getTargetPanel(JMXConfigWizardIterator.java:208)
        at org.netbeans.modules.jmx.configwizard.JMXConfigWizardIterator.initialize(JMXConfigWizardIterator.java:282)
...

In my experiments, the first time you select this template it passes new SourceGroup[0]; Back and Next will cause it to
pass null (which is legal); selecting some other template in the same category, Back, then Next on this template will
cause it to pass new SourceGroup[] {src, test}. Probably the code

  ProjectUtils.getSources(project).getSourceGroups("properties")

is responsible, whatever that is supposed to accomplish. (I have never heard of source groups using a type by that name;
I would expect it to always return new SourceGroup[0].)
Comment 11 Quality Engineering 2009-04-10 07:36:21 UTC
Integrated into 'main-golden', will be available in build *200904100201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/72b0d69d1271
User: Jesse Glick <jglick@netbeans.org>
Log: #161478 diagnostics: NPE traced back to bug in client.