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 111862 - NPE from xerces.internal.dom.DeferredElementNSImpl.synchronizeData
Summary: NPE from xerces.internal.dom.DeferredElementNSImpl.synchronizeData
Status: RESOLVED FIXED
Alias: None
Product: projects
Classification: Unclassified
Component: Ant (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Jesse Glick
URL:
Keywords: RANDOM
: 115287 117521 118648 118940 119737 (view as bug list)
Depends on: 154502
Blocks:
  Show dependency tree
 
Reported: 2007-08-03 10:09 UTC by _ leonchiver
Modified: 2009-04-14 04:33 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Ant Shortcuts (2.28 KB, application/octet-stream)
2007-08-03 10:19 UTC, _ leonchiver
Details
Logfile (47.90 KB, text/plain)
2007-08-03 10:20 UTC, _ leonchiver
Details
Logfile again (this is the correct one) (53.53 KB, text/plain)
2007-08-03 10:22 UTC, _ leonchiver
Details

Note You need to log in before you can comment on or make changes to this bug.
Description _ leonchiver 2007-08-03 10:09:46 UTC
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)
Comment 1 Jesse Glick 2007-08-03 10:12:31 UTC
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.
Comment 2 _ leonchiver 2007-08-03 10:19:46 UTC
Created attachment 46112 [details]
Ant Shortcuts
Comment 3 _ leonchiver 2007-08-03 10:20:48 UTC
Created attachment 46113 [details]
Logfile
Comment 4 _ leonchiver 2007-08-03 10:22:19 UTC
Created attachment 46114 [details]
Logfile again (this is the correct one)
Comment 5 Jesse Glick 2007-08-03 10:53:37 UTC
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.
Comment 6 Jesse Glick 2007-08-14 20:20:32 UTC
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)
Comment 7 Jesse Glick 2007-09-13 22:27:41 UTC
*** Issue 115287 has been marked as a duplicate of this issue. ***
Comment 8 Jesse Glick 2007-10-02 21:11:45 UTC
*** Issue 117521 has been marked as a duplicate of this issue. ***
Comment 9 Jesse Glick 2007-10-12 18:29:56 UTC
*** Issue 118648 has been marked as a duplicate of this issue. ***
Comment 10 Jesse Glick 2007-10-15 23:16:48 UTC
*** Issue 118940 has been marked as a duplicate of this issue. ***
Comment 11 Jesse Glick 2007-10-23 17:04:35 UTC
*** Issue 119737 has been marked as a duplicate of this issue. ***
Comment 12 pzajac 2007-10-24 15:31:36 UTC
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). 
Comment 13 Jesse Glick 2007-10-24 15:55:12 UTC
I think it's more general than shortcuts to targets. Do you have some way of reproducing, even only sometimes?
Comment 14 pzajac 2007-10-24 16:48:26 UTC
Sorry, I don't have. It works fine now. 
Comment 15 Jesse Glick 2007-10-25 23:34:00 UTC
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