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 80439 - Deleting a file can generate a NPE
Summary: Deleting a file can generate a NPE
Status: VERIFIED FIXED
Alias: None
Product: xml
Classification: Unclassified
Component: XAM (show other bugs)
Version: 5.x
Hardware: PC Windows XP
: P1 blocker (vote)
Assignee: issues@xml
URL:
Keywords:
Depends on:
Blocks: 79316
  Show dependency tree
 
Reported: 2006-07-17 21:49 UTC by Praveen Savur
Modified: 2007-03-27 21:46 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Praveen Savur 2006-07-17 21:49:33 UTC
1) Work on a large file like the OTA schema. Keep expanding columns, editing etc.,
2) Delete the file throws the exception below:

3) This is sometimes reproducible in schema but a related bug is more
reproducible from BPEL.

 The first four lines of the stack trace is also seen while running validation
from BPEL. So once this is fixed in xam, the other bpel validation bug can also
be fixed.





java.lang.NullPointerException
	at
org.openide.util.lookup.InstanceContent$SimpleItem.<init>(InstanceContent.java:150)
	at org.openide.util.lookup.SimpleLookup.<init>(SimpleLookup.java:47)
	at org.openide.util.lookup.Lookups.fixed(Lookups.java:75)
	at
org.netbeans.modules.xml.retriever.catalog.Utilities$1.getLookup(Utilities.java:595)
	at org.openide.util.lookup.SimpleProxyLookup.checkLookup(SimpleProxyLookup.java:55)
	at org.openide.util.lookup.SimpleProxyLookup.lookup(SimpleProxyLookup.java:116)
	at
org.netbeans.modules.xml.xam.dom.AbstractDocumentModel.needsSync(AbstractDocumentModel.java:89)
	at org.netbeans.modules.xml.xam.AbstractModel.prepareSync(AbstractModel.java:208)
	at org.netbeans.modules.xml.xam.AbstractModel.runAutoSync(AbstractModel.java:496)
	at
org.netbeans.modules.xml.xam.AbstractModelFactory$1.run(AbstractModelFactory.java:94)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:499)
[catch] at
org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:932)
Comment 1 Nam Nguyen 2006-07-17 23:38:03 UTC
Praveen:
I added assertions for easier debugging.  Please sync and try ASAP.
/cvs/xml/retriever/src/org/netbeans/modules/xml/retriever/catalog/Attic/Utilities.java,v
 <--  Utilities.java
new revision: 1.1.2.5; previous revision: 1.1.2.4
Comment 2 Praveen Savur 2006-07-18 00:12:57 UTC
Here is the trace with few debug messages attached:


org.openide.loaders.DataObjectNotFoundException:
MasterFileObject@179e4bc[C:/temp2/to_delete/sync1a/BpelModule1/src/newProcess.bpel]
        at org.openide.loaders.DataObject.find(DataObject.java:474)
        at
org.netbeans.modules.xml.retriever.catalog.Utilities._getDocument(Utilities.java:520)
        at
org.netbeans.modules.xml.retriever.catalog.Utilities$1.getLookup(Utilities.java:594)
        at
org.openide.util.lookup.SimpleProxyLookup.checkLookup(SimpleProxyLookup.java:55)
        at
org.openide.util.lookup.SimpleProxyLookup.lookup(SimpleProxyLookup.java:116)
        at
org.netbeans.modules.xml.xam.dom.AbstractDocumentModel.getBaseDocument(AbstractDocumentModel.java:65)
        at
org.netbeans.modules.xml.xam.spi.XsdBasedValidator.validate(XsdBasedValidator.java:96)
        at
org.netbeans.modules.xml.xam.spi.XsdBasedValidator.validate(XsdBasedValidator.java:78)
        at org.netbeans.modules.xml.xam.spi.Validation.validate(Validation.java:73)
        at
org.netbeans.modules.bpel.core.validation.BPELValidationController$1$1.call(BPELValidationController.java:139)
        at
org.netbeans.modules.bpel.model.impl.BpelModelImpl.invoke(BpelModelImpl.java:232)
        at
org.netbeans.modules.bpel.core.validation.BPELValidationController$1.run(BPELValidationController.java:153)
        at java.util.TimerThread.mainLoop(Timer.java:512)
        at java.util.TimerThread.run(Timer.java:462)
Caused by: org.openide.filesystems.FileStateInvalidException:
MasterFileObject@179e4bc[C:/temp2/to_delete/sync1a/BpelModule1/src/newProcess.bpel]
        at org.openide.loaders.DataObject.find(DataObject.java:454)
        ... 13 more
Jul 17, 2006 4:15:05 PM org.netbeans.modules.xml.retriever.catalog.Utilities$1
getLookup
SEVERE: unable to obtain swing document
 
dobj=org.netbeans.modules.bpel.core.BPELDataObject@1ea0e66[MasterFileObject@179e4bc[C:/temp2/to_delete/sync1a/BpelModule1/src/newProcess.bpel]]

*********** Exception occurred ************ at 4:15 PM on Jul 17, 2006
java.lang.AssertionError: Couldn't get Swing Document from file
MasterFileObject@179e4bc[C:/temp2/to_delete/sync1a/BpelModule1/src/newProcess.bpel]
        at
org.netbeans.modules.xml.retriever.catalog.Utilities$1.getLookup(Utilities.java:602)
        at
org.openide.util.lookup.SimpleProxyLookup.checkLookup(SimpleProxyLookup.java:55)
        at
org.openide.util.lookup.SimpleProxyLookup.lookup(SimpleProxyLookup.java:116)
        at
org.netbeans.modules.xml.xam.dom.AbstractDocumentModel.getBaseDocument(AbstractDocumentModel.java:65)
        at
org.netbeans.modules.xml.xam.spi.XsdBasedValidator.validate(XsdBasedValidator.java:96)
        at
org.netbeans.modules.xml.xam.spi.XsdBasedValidator.validate(XsdBasedValidator.java:78)
        at org.netbeans.modules.xml.xam.spi.Validation.validate(Validation.java:73)
        at
org.netbeans.modules.bpel.core.validation.BPELValidationController$1$1.call(BPELValidationController.java:139)
        at
org.netbeans.modules.bpel.model.impl.BpelModelImpl.invoke(BpelModelImpl.java:232)
        at
org.netbeans.modules.bpel.core.validation.BPELValidationController$1.run(BPELValidationController.java:153)
        at java.util.TimerThread.mainLoop(Timer.java:512)
[catch] at java.util.TimerThread.run(Timer.java:462)
Comment 3 Nam Nguyen 2006-07-18 02:42:30 UTC
Fix checked in:
/cvs/xml/retriever/src/org/netbeans/modules/xml/retriever/catalog/Attic/Utilities.java,v
 <--  Utilities.java
new revision: 1.1.2.6; previous revision: 1.1.2.5
/cvs/xml/xam/src/org/netbeans/modules/xml/xam/AbstractModelFactory.java,v  <-- 
AbstractModelFactory.java
new revision: 1.2.2.18; previous revision: 1.2.2.17
Comment 4 Nam Nguyen 2006-07-18 02:45:48 UTC
Praveen, please note that now a modelsource lookup could return null for File or
FileObject in which case it means the source file has been delete or has io
issue since the model source was created.  So, (validation) background process
needs to check for this condition properly.
Comment 5 Nam Nguyen 2006-07-18 03:02:42 UTC
Additional changes to xsd based validators that might be run in the background.

/cvs/xml/schema/api/src/org/netbeans/modules/xml/schema/model/validation/Attic/SchemaXsdBasedValidator.java,v
 <--  SchemaXsdBasedValidator.java
new revision: 1.1.2.6; previous revision: 1.1.2.5
cvs/xml/xam/src/org/netbeans/modules/xml/xam/spi/Attic/XsdBasedValidator.java,v
 <--  XsdBasedValidator.java
new revision: 1.1.2.9; previous revision: 1.1.2.8
Comment 6 tonybeckham 2007-03-27 21:46:54 UTC
Fix VERIFIED Build 200703191900