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.
The conditions under which the NPE occurs, are the same as in #101314: For large project, try the following. Open "Open project" dialog. Select the project and then click "Open" button (or press Enter key). If "Open" is clicked while "Required projects" list is filling (i.e. while "Please wait..." is displaying in the list), NPE occurs. java.lang.NullPointerException at org.netbeans.modules.cnd.makeproject.MobilityBridge.getConfigurationsImpl(MobilityBridge.java:84) at org.netbeans.modules.cnd.makeproject.MobilityBridge.addPropertyChangeListener(MobilityBridge.java:164) at org.netbeans.modules.cnd.makeproject.MobilityBridge.invoke(MobilityBridge.java:114) at $Proxy7.addPropertyChangeListener(Unknown Source) at org.netbeans.modules.project.support.ActiveConfigAction.activeProjectChanged(ActiveConfigAction.java:197) at org.netbeans.modules.project.support.ActiveConfigAction.access$200(ActiveConfigAction.java:55) at org.netbeans.modules.project.support.ActiveConfigAction$1.enable(ActiveConfigAction.java:89) at org.netbeans.modules.project.ui.actions.MainProjectAction.refreshView(MainProjectAction.java:129) at org.netbeans.modules.project.ui.actions.MainProjectAction.propertyChange(MainProjectAction.java:118) at org.openide.util.WeakListenerImpl$PropertyChange.propertyChange(WeakListenerImpl.java:151) at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:339) at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:276) at org.netbeans.modules.project.ui.OpenProjectList.setMainProject(OpenProjectList.java:427) [catch] at org.netbeans.modules.project.ui.actions.NewProject$2.run(NewProject.java:175) 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)
Seems that ConfigurationDescriptorProvider.getConfigurationDescriptor() returns null (which is probably also the cause of issue #101314). I would propose to: -investigate why CDP.getCD() returns null, and if it can be modified not to return null -it there is a compelling reason why CDP.getCD() returns null, prevent the NPE in the MobilityBridge and throw correct events when CDP.getCD() turns non-null (will probably need careful testing).
The issue is that Netbeans notification comes before native project is completely initialized. The configuration descriptors are initialized in ProjectOpenedHook (MakeProject.ProjectOpenedHookImpl.projectOpened). This issue is related (though does not duplicate) #101314. Please see my comments to #101314
Hm, I think that the projects should not rely on ProjectOpenedHook for such things. I think that the project configurations should be available regardless the project was already opened or not. But, I do not see that the POH for CND project would actually compute the configurations - it seems to be computed somehow asynchronously (see MakeProject:491). Maybe I miss something? I would consider such asynchronous initialization quite dangerous.
I've raised priority to P1 because the exception occurs every time when user opens a big project (e.g. boost) with a fresh userdir. Please fix it ASAP as it's a real showstopper.
I have changed the logic of ConfigurationDescriptorProvider.getConfigurationDescriptor. the problem was in syncronization. - Someone called this method first time - hasTried set to true - reading of XML file started - it takes long time - another thread call method hasTried already true, but projectDescriptor is still null => null is returned The change was made to wait for the finish of reading, but at the same time read only once. Please, review the changes. cvs log:
cvs log: Checking in ConfigurationDescriptorProvider.java; /shared/data/ccvs/repository/cnd/makeproject/src/org/netbeans/modules/cnd/makeproject/api/configurations/ConfigurationDescriptorProvider.java,v <-- ConfigurationDescriptorProvider.java new revision: 1.2.2.2.8.3; previous revision: 1.2.2.2.8.2 done
verified in 200712050000 build