Bug 221342 - A lot of NPE while indexing by xerces.internal.impl.XMLScanner
A lot of NPE while indexing by xerces.internal.impl.XMLScanner
Status: RESOLVED FIXED
Product: platform
Classification: Unclassified
Component: Filesystems
7.2
All All
: P4 (vote)
: 8.0
Assigned To: Jaroslav Havlin
issues@platform
: PERFORMANCE
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-11-02 12:15 UTC by Alexander Simon
Modified: 2013-11-07 15:33 UTC (History)
0 users

See Also:
Issue Type: DEFECT
:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Simon 2012-11-02 12:15:56 UTC
Each NPE is repeated hundred times:
ALL [null]: While parsing: MIMESupport$CachedFileObject@1db7558[/export/home/as204739/Projects/sfbay/mozilla-2.0/config/tests/ref-simple/two/otherfile.xml]
INFO [org.netbeans.modules.openide.filesystems.declmime.DefaultParser]
While parsing: MIMESupport$CachedFileObject@1db7558[/export/home/as204739/Projects/sfbay/mozilla-2.0/config/tests/ref-simple/two/otherfile.xml]
While parsing: MIMESupport$CachedFileObject@1db7558[/export/home/as204739/Projects/sfbay/mozilla-2.0/config/tests/ref-simple/two/otherfile.xml]
Caused: java.lang.NullPointerException
	at com.sun.org.apache.xerces.internal.impl.XMLScanner.scanXMLDeclOrTextDecl(XMLScanner.java:503)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanXMLDeclOrTextDecl(XMLDocumentFragmentScannerImpl.java:954)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$XMLDeclDriver.next(XMLDocumentScannerImpl.java:815)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:647)
	at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:453)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
	at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
[catch] at org.netbeans.modules.openide.filesystems.declmime.DefaultParser.parse(DefaultParser.java:139)
	at org.netbeans.modules.openide.filesystems.declmime.XMLMIMEComponent$SniffingParser.sniff(XMLMIMEComponent.java:292)
	at org.netbeans.modules.openide.filesystems.declmime.XMLMIMEComponent.acceptFileObject(XMLMIMEComponent.java:106)
	at org.netbeans.modules.openide.filesystems.declmime.FileElement.resolve(FileElement.java:100)
	at org.netbeans.modules.openide.filesystems.declmime.MIMEResolverImpl$Impl.findMIMEType(MIMEResolverImpl.java:440)
	at org.openide.filesystems.MIMESupport$CachedFileObject.resolveMIME(MIMESupport.java:371)
	at org.openide.filesystems.MIMESupport$CachedFileObject.getMIMEType(MIMESupport.java:312)
	at org.openide.filesystems.MIMESupport.findMIMEType(MIMESupport.java:136)
	at org.openide.filesystems.FileUtil.getMIMEType(FileUtil.java:1493)
	at org.openide.filesystems.FileObject.getMIMEType(FileObject.java:658)
	at org.netbeans.modules.xml.util.DefaultXmlFileEncodingQueryImpl.getEncoding(DefaultXmlFileEncodingQueryImpl.java:49)
	at org.netbeans.api.queries.FileEncodingQuery.getEncoding(FileEncodingQuery.java:96)
	at org.netbeans.modules.tasklist.todo.TodoTaskScanner.getContent(TodoTaskScanner.java:372)
	at org.netbeans.modules.tasklist.todo.TodoTaskScanner.scanComments(TodoTaskScanner.java:196)
	at org.netbeans.modules.tasklist.todo.TodoTaskScanner.scan(TodoTaskScanner.java:105)
	at org.netbeans.modules.tasklist.impl.TaskIndexer.index(TaskIndexer.java:153)
	at org.netbeans.modules.parsing.spi.indexing.Indexable$MyAccessor$2.run(Indexable.java:158)
	at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater.runIndexer(RepositoryUpdater.java:267)
	at org.netbeans.modules.parsing.spi.indexing.Indexable$MyAccessor.index(Indexable.java:156)
	at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$Work.doIndex(RepositoryUpdater.java:2498)
	at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$Work.access$1500(RepositoryUpdater.java:2096)
	at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$Work$2.run(RepositoryUpdater.java:2405)
	at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$Work$2.run(RepositoryUpdater.java:2403)
	at org.netbeans.modules.parsing.impl.indexing.errors.TaskCache.refreshTransaction(TaskCache.java:544)
	at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$Work.index(RepositoryUpdater.java:2403)
	at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$AbstractRootsWork.scanSource(RepositoryUpdater.java:4886)
	at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$AbstractRootsWork.scanSources(RepositoryUpdater.java:4605)
	at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$RootsWork.getDone(RepositoryUpdater.java:4310)
	at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$InitialRootsWork.getDone(RepositoryUpdater.java:4980)
	at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$Work.doTheWork(RepositoryUpdater.java:3022)
	at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$Task._run(RepositoryUpdater.java:5313)
	at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$Task.access$4800(RepositoryUpdater.java:4993)
	at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$Task$2$1.run(RepositoryUpdater.java:5238)
	at org.netbeans.modules.parsing.impl.RunWhenScanFinishedSupport.performScan(RunWhenScanFinishedSupport.java:96)
	at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$Task$2.call(RepositoryUpdater.java:5234)
	at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$Task$2.call(RepositoryUpdater.java:5230)
	at org.netbeans.modules.masterfs.filebasedfs.utils.FileChangedManager.priorityIO(FileChangedManager.java:176)
	at org.netbeans.modules.masterfs.providers.ProvidedExtensions.priorityIO(ProvidedExtensions.java:360)
	at org.netbeans.modules.parsing.impl.Utilities.runPriorityIO(Utilities.java:74)
	at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$Task.run(RepositoryUpdater.java:5230)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1454)
	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2036)
Comment 1 Jaroslav Tulach 2012-11-08 08:07:50 UTC
Consider checking what is com.sun.org.apache.xerces.internal.impl.XMLScanner.scanXMLDeclOrTextDecl(XMLScanner.java:503)
in your JDK and what is causing your NPE.
Comment 2 Alexander Simon 2012-11-08 08:43:24 UTC
Sorry I do not understand your position.
We have a several issues:
1. Mime resolver parses whole document to detect mime type.
2. The exception while parsing of one document is repeated hundred times.
Both problem are performance problem.

IDE info:
>System Info: 
  Operating System        = SunOS version 5.10 running on x86
  Java; VM; Vendor        = 1.6.0_33; Java HotSpot(TM) Client VM 20.8-b03; Sun Microsystems Inc.
  Runtime                 = Java(TM) SE Runtime Environment 1.6.0_33-b03

Probably you suggest to fix JDK?
Comment 3 Jaroslav Tulach 2012-11-08 09:05:19 UTC
My position is clear: unless you provided version of JDK, your report was invalid.

Too bad it is now valid. I will have to deal with it. I guess you can't reproduce the failure, right?
Comment 4 Jaroslav Havlin 2013-11-07 15:33:21 UTC
> 1. Mime resolver parses whole document to detect mime type.
It reads only the beginning of the file, see bug 230305.

> 2. The exception while parsing of one document is repeated hundred times.
http://hg.netbeans.org/core-main/rev/ba7d0c968fc1

Thank you for reporting.


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo