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.
This bug was originally marked as duplicate of bug 190041, that is already resolved. This bug is still valid, so this seems to be another bug, but it might be related. Build: NetBeans IDE 7.0.1 (Build 201107282000) VM: Java HotSpot(TM) Client VM, 20.2-b06, Java(TM) SE Runtime Environment, 1.6.0_27-b07 OS: Windows 7 User Comments: sreder: Just clean/building a maven project Stacktrace: java.lang.IllegalStateException: The model is not initialized or is broken. at org.netbeans.modules.xml.xdm.XDMModel.checkStableOrParsingState(XDMModel.java:1001) at org.netbeans.modules.xml.xdm.XDMModel.getDocument(XDMModel.java:839) at org.netbeans.modules.xml.xdm.nodes.NodeImpl.getNamespaceURI(NodeImpl.java:604) at org.netbeans.modules.xml.xam.dom.AbstractDocumentComponent.getQName(AbstractDocumentComponent.java:778) at org.netbeans.modules.xml.xam.dom.AbstractDocumentComponent.getQName(AbstractDocumentComponent.java:774) at org.netbeans.modules.maven.model.pom.impl.POMComponentImpl.getChildElementText(POMComponentImpl.java:162)
Created attachment 111890 [details] stacktrace
*** Bug 190040 has been marked as a duplicate of this bug. ***
*** Bug 184595 has been marked as a duplicate of this bug. ***
Created attachment 118286 [details] stacktrace having two maven pom.xml files open, selecting dependencies from one file, switching to other file with the intent to paste the conten.
Created attachment 120118 [details] stacktrace editing pom.xml
This bug already has 20 duplicates see http://statistics.netbeans.org/exceptions/detail.do?id=181899
I still cannot reproduce the issue under debugger. Is the file broken (at the time when the error happens) ? Do you edit the file, or open it ? It's timing - dependent anyway, I put some delay to the navigator and I am able to trigger the defect from time to time when working on not-wellformed file.
As far as I remember the bug appeared on opening a well formed POM (Maven) XML file. But it might be really the case that I opened it in order to fix the xml.
OK, after applying some logs: 1/ the file gets selected. At that time, the file is valid and the Maven model is created using MavenEmbedder.createModelLineage. This call SUCCEEDS, the file is OK at the moment 2a/ the Navigator attempts to resolve individual artifacts from the POM. It also refreshes the resolved POMs and creates POMModels 2b/ the editor content is changed in parallel to 2a This may happen e.g. if the artifact resolution is slow, FU.refresh() is slow on a POM etc. The 'broken' navigator contents is only displayed when the createModelLineage fails, if POM becomes invalid after that, the navigator attempts to display POM children, which access the model, and fail on BROKEN model. See for example report http://bugzilla-attachments-203551.netbeans.org/bugzilla/attachment.cgi?id=111890 - a tooltip is being displayed while the model is already broken. All such calls from navigator Node implementations must be somehow guarded and return some standard 'error' value, perhaps triggering POMModelPanel.showTask() to reconsider the navigator contents. I also suggest to make one more check at the end of data preparation in POMModelPanel, and display Error node if the model becomes broken.
I'd like to waive this issue, the number of occurrences in exception reporter since 6.8 is not that high and threading and synchronization has always been a sinister problem when dealing with the pom's xam model.
https://hg.netbeans.org/core-main/rev/4cd0d9c0168e fix attampts to approach the problem by creating a non-managed model that doesn't automatically synchronize with the document. Only updates as the file gets saved.
Integrated into 'main-golden', will be available in build *201208310001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/4cd0d9c0168e User: Milos Kleint <mkleint@netbeans.org> Log: #203551 create a fresh, not managed model for the navigator view, The model is only updated when file gets saven now. adding asserts that should verify the assmption made about xam/xdm