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 123562 - navigator window does not work with inspector window.
Summary: navigator window does not work with inspector window.
Status: RESOLVED DUPLICATE of bug 123679
Alias: None
Product: platform
Classification: Unclassified
Component: Navigator (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Jaroslav Tulach
URL:
Keywords:
: 123023 132549 (view as bug list)
Depends on:
Blocks: 125861
  Show dependency tree
 
Reported: 2007-12-06 11:49 UTC by Kenji Tachibana
Modified: 2008-12-22 11:46 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
stacktrace (7.45 KB, text/plain)
2008-06-17 02:57 UTC, ravilan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kenji Tachibana 2007-12-06 11:49:17 UTC
When I open the inspector window after creating a page with Visual Web JSF,
navigation window output strange result.
Sometimes, it's displayed JSP structure, sometime become blank.
Then, close navigation window and reopen it from window -> navigating -> navigator,
now navigator window displayed '<No view Available>' and following 
exception is output in log file.

[global]
java.lang.ArrayIndexOutOfBoundsException: 1
        at org.openide.util.lookup.ProxyLookup$R.lookupChange(ProxyLookup.java:393)
        at org.openide.util.lookup.ProxyLookup.setLookups(ProxyLookup.java:187)
        at
org.netbeans.modules.project.ui.actions.LookupSensitiveAction$LastActivatedWindowLookup.updateLookups(LookupSensitiveAction.java:218)
        at
org.netbeans.modules.project.ui.actions.LookupSensitiveAction$LastActivatedWindowLookup.propertyChange(LookupSensitiveAction.java:223)
        at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:333)
        at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:270)
        at org.netbeans.core.windows.RegistryImpl.tryFireChanges(RegistryImpl.java:297)
        at org.netbeans.core.windows.RegistryImpl.selectedNodesChanged(RegistryImpl.java:233)
        at org.netbeans.core.windows.RegistryImpl.topComponentActivated(RegistryImpl.java:170)
        at org.netbeans.core.windows.WindowManagerImpl.notifyRegistryTopComponentActivated(WindowManagerImpl.java:984)
        at org.netbeans.core.windows.Central.addModeClosedTopComponent(Central.java:820)

If I restart the netbeans6.0, navigation become correct one. 


To reproduce:
  1. Create Visual Web JSF project.
  2. Create a button in design editor
  3. Confirm that navigator window is displayed that button
  4. Open inspector window from  window -> navigating -> inspector
  5. Now navigation window displayed different from #3.
  6. Close navigation window, and open again from window -> navigating -> navigator
  7. '<No view Available>' is displayed in navigator window, and output Exception in log file.
Comment 1 gholmer 2007-12-23 00:33:26 UTC
I am seeing this exact same behavior. NetBeans 6.0 FCS on openSUSE 10.3.
Comment 2 Mark Dey 2008-01-03 23:30:36 UTC
It looks like there may be some contention between the JSP and JSF data loaders when rendering information in the Navigator window. 
Comment 3 Quy Nguyen 2008-01-04 01:17:08 UTC
There is also the following related exception that occurs as well:

java.lang.ArrayIndexOutOfBoundsException: 1
	at org.openide.util.lookup.ProxyLookup$R.lookupChange(ProxyLookup.java:393)
	at org.openide.util.lookup.ProxyLookup.setLookups(ProxyLookup.java:187)
	at org.netbeans.modules.navigator.NavigatorController$ClientsLookup.beforeLookup(NavigatorController.java:652)
	at org.openide.util.lookup.ProxyLookup.lookup(ProxyLookup.java:232)
	at org.netbeans.modules.navigator.NavigatorController.updateContext(NavigatorController.java:354)
	at org.netbeans.modules.navigator.NavigatorController.updateContext(NavigatorController.java:256)
	at org.netbeans.modules.navigator.NavigatorController.access$700(NavigatorController.java:98)
[catch] at org.netbeans.modules.navigator.NavigatorController$ActNodeSetter.run(NavigatorController.java:614)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)


To reproduce this,

1) Create/open a project with a single button component.
2) Select the button.  The navigator should display the outline with the path to the button component
3) Open the inspector without deselecting the button
4) Close the inspector.  The navigator should be visible again.
4) Click on the designer.  The exception should occur here.

It appears that in this case, the same DesignBeanNode is represented twice in the global activated node lookup result. 
This causes the exception in ProxyLookup$R.lookupChange().  This is not related to the jsf loader support but is
probably an issue with the outline or the designer since the loader does not manage the designer's TopComponent.
Comment 4 Peter Zavadsky 2008-01-05 01:14:02 UTC
This seems to be a problem of the navigator (see the stack trace), passing there.
Comment 5 Quy Nguyen 2008-01-10 01:20:34 UTC
I see this exception happening when working with normal java projects as well.  However, in those cases, the navigator
recovers and still displays information.  Is there a reason why the visual web Outline stops working when the same
exception occurs?
Comment 6 David Simonek 2008-01-17 12:59:34 UTC
Finally got it and reproduced...trying to find what is going on.
Comment 7 David Simonek 2008-01-21 16:24:19 UTC
Problem is really that array of activated nodes contains the same instance of DesignBeanNode twice. Navigator got such
array from call of getPanelLookup().lookupAll(Node.class); where panel is visualweb's OutlineView. ProxyLookup can't
survive such duplication of lookups from nodes then.

Fixes should be provided on various places IMHO - OutlinePanel shoudn't duplicate nodes in its lookup, Navigator or
TopComponent.setActivatedNodes should check for duplications and finally ProxyLookup should survive such situation. More
on this tomorrow, I think I'll need consultation with jtulach on proxylookup thing.

Comment 8 David Simonek 2008-01-23 17:40:19 UTC
Update after work with jtulach:
visualweb's outline view is innocent, there are basically two problems:

a) ProxyLookup can't handle situation when there is setLookups(...) called with array of two identical Lookups as its
param, and then again called setLookups only on one lookup and all of this is happening in beforeLookup hook. Then
ProxyLookup's internal structures go out of sync, namely "old" array and "weakL.results" array, causing exception above.
I'm passing this problem to jtulach to fix.

b) There is also Navigator infastructure problem, that is causing two identical Nodes being put as activated nodes of
the navigator's TopComponent. This will be solved in separate issue - 
Comment 9 David Simonek 2008-01-23 17:42:45 UTC
Separate issue for b) is 125861
Comment 10 David Simonek 2008-02-06 10:52:16 UTC
*** Issue 123023 has been marked as a duplicate of this issue. ***
Comment 11 Jaroslav Tulach 2008-02-07 09:00:50 UTC
Now, when I fixed issue 123679, I believe this one will be fixed as well. Please verify or reopen.

*** This issue has been marked as a duplicate of 123679 ***
Comment 12 David Simonek 2008-04-23 13:55:35 UTC
*** Issue 132549 has been marked as a duplicate of this issue. ***
Comment 13 ravilan 2008-06-17 02:57:56 UTC
Created attachment 62901 [details]
stacktrace