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.
Sometimes when starting NetBeans I'm getting this exception. It happens in a current CVS build, but it already happened in the past too. java.lang.NullPointerException at com.sun.org.apache.xerces.internal.dom.DeferredElementNSImpl.synchronizeData(DeferredElementNSImpl.java:103) at com.sun.org.apache.xerces.internal.dom.ElementImpl.getAttribute(ElementImpl.java:252) at org.apache.tools.ant.module.loader.AntActionInstance.getValue(AntActionInstance.java:164) at org.apache.tools.ant.module.loader.AntActionInstance.stateChanged(AntActionInstance.java:235) at org.openide.util.WeakListenerImpl$Change.stateChanged(WeakListenerImpl.java:297) at org.openide.util.ChangeSupport.fireChange(ChangeSupport.java:101) at org.openide.util.ChangeSupport.fireChange(ChangeSupport.java:87) at org.apache.tools.ant.module.xml.AntProjectSupport$ChangeFirer.run(AntProjectSupport.java:351) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:539) [catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:964)
You need to attach your log file, so I can see if you are e.g. using an unsupported version of Xerces by accident. (The bug looks to be in Xerces, not NB.) Also please attach your Ant shortcuts; look for *.xml Ant scripts in your userdir's config/ subdir.
Created attachment 46112 [details] Ant Shortcuts
Created attachment 46113 [details] Logfile
Created attachment 46114 [details] Logfile again (this is the correct one)
In JDK 6.0u2 version of Xerces: name = ownerDocument.getNodeName(fNodeIndex); int index = name.indexOf(':'); // <-- NPE Looks to be the same in JDK 7, same in Xerces 2.8.0, and nearly the same in JDK 5. So not some kind of recent bug, I guess. I do not see any corrupt shortcuts etc. Leaving open but INCOMPLETE as I have no recollection of anyone getting a similar NPE. If you figure out how to reproduce, of course say so. (Hint: make a complete copy of your NB installation for archival purposes, then make a copy of your userdir, and start removing experimental modules, Ant shortcuts, customizations, etc. - anything in your user dir - and bisect.) Otherwise I will have to close at some point.
I also got an unreproducible: java.lang.NullPointerException at com.sun.org.apache.xerces.internal.dom.DeferredElementNSImpl.synchronizeData(DeferredElementNSImpl.java:145) at com.sun.org.apache.xerces.internal.dom.ElementImpl.getAttribute(ElementImpl.java:281) at org.apache.tools.ant.module.loader.AntProjectDataEditor.annotateWithProjectName(AntProjectDataEditor.java:92) at org.apache.tools.ant.module.loader.AntProjectDataEditor.messageName(AntProjectDataEditor.java:73) at org.openide.text.CloneableEditor$2.run(CloneableEditor.java:452) at org.openide.util.Mutex.doEvent(Mutex.java:1181) at org.openide.util.Mutex.writeAccess(Mutex.java:376) at org.openide.text.CloneableEditor.updateName(CloneableEditor.java:447) at org.openide.text.CloneableEditorSupport.updateTitles(CloneableEditorSupport.java:2020) at org.openide.text.CloneableEditorSupport.notifyModified(CloneableEditorSupport.java:1661) at org.apache.tools.ant.module.loader.AntProjectDataEditor.notifyModified(AntProjectDataEditor.java:54) at org.openide.text.CloneableEditorSupport.callNotifyModified(CloneableEditorSupport.java:1578) at org.openide.text.CloneableEditorSupport$Listener.vetoableChange(CloneableEditorSupport.java:2402) at org.netbeans.editor.BaseDocument.notifyModify(BaseDocument.java:1491)
*** Issue 115287 has been marked as a duplicate of this issue. ***
*** Issue 117521 has been marked as a duplicate of this issue. ***
*** Issue 118648 has been marked as a duplicate of this issue. ***
*** Issue 118940 has been marked as a duplicate of this issue. ***
*** Issue 119737 has been marked as a duplicate of this issue. ***
Is the issue still incomplete? It's probably related with shortcuts to ant target in main menu. The exception is thrown on startup (but not everytime).
I think it's more general than shortcuts to targets. Do you have some way of reproducing, even only sometimes?
Sorry, I don't have. It works fine now.
I cannot reproduce this. But under the guess that this is a race condition caused by unsynchronized access to a DOM tree, I have added code to clone the document before returning it to anyone: Checking in AntProjectSupport.java; /shared/data/ccvs/repository/ant/src/org/apache/tools/ant/module/xml/AntProjectSupport.java,v <-- AntProjectSupport.java new revision: 1.40; previous revision: 1.39 done