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.
Summary: | [67cat] ClassCastException: org.netbeans.modules.html.editor.gsf.HtmlParserResult | ||
---|---|---|---|
Product: | editor | Reporter: | ki4ngel <ki4ngel> |
Component: | Parsing & Indexing | Assignee: | Jan Jancura <jjancura> |
Status: | RESOLVED FIXED | ||
Severity: | blocker | CC: | anobbe, blakenzoe, camilo_u, dancehands, dark4832, encripted, georgechongzhi, grafi, hugheba, inkubus08, ivansidorkin, jarod51, jjancura, jkovalsky, jonast, jordao, jvandemerwe, kganfield, laurin1, limptwiglet, lqqkout4elfy, mfukala, microugly, mjreged, mmirilovic, monguz, mpapis, ndwolf, pachico, paulanormannz, pjiricka, pluszak, pribyl, qingyue, rbrink, reynirh, rmatous, robert_h, rohitbrai, salahaa1, sandange, sternix, tprochazka, tslota, typhos, westleyd |
Priority: | P1 | Keywords: | RANDOM |
Version: | 6.x | ||
Hardware: | All | ||
OS: | All | ||
URL: | http://statistics.netbeans.org/exceptions/detail.do?id=148002 | ||
Issue Type: | DEFECT | Exception Reporter: | 148002 |
Attachments: |
stacktrace
stacktrace stacktrace stacktrace stacktrace stacktrace stacktrace stacktrace stacktrace |
Description
ki4ngel
2009-03-24 15:07:56 UTC
Created attachment 78754 [details]
stacktrace
Build: NetBeans IDE Dev (Build 200903231401) VM: Java HotSpot(TM) Client VM, 11.2-b01, Java(TM) SE Runtime Environment, 1.6.0_12-b04 OS: Linux, 2.6.28.7-blac2-mx-core2, i386 User Comments: Stacktrace: java.lang.ClassCastException: org.netbeans.modules.html.editor.gsf.HtmlParserResult cannot be cast to org.netbeans.modules.php.editor.parser.PHPParseResult at org.netbeans.modules.php.editor.parser.SemanticAnalysis.run(SemanticAnalysis.java:92) at org.netbeans.modules.csl.editor.semantic.SemanticHighlighter.process(SemanticHighlighter.java:306) at org.netbeans.modules.csl.editor.semantic.SemanticHighlighter.access$000(SemanticHighlighter.java:80) at org.netbeans.modules.csl.editor.semantic.SemanticHighlighter$1.run(SemanticHighlighter.java:139) at org.netbeans.modules.csl.editor.semantic.SemanticHighlighter$1.run(SemanticHighlighter.java:148) at org.netbeans.modules.parsing.api.ParserManager$UserTaskAction.run(ParserManager.java:128) Created attachment 78771 [details]
stacktrace
Is there anything specific about the file where it occurred? E.g. was it html file renamed to PHP or something like that? Did you customize the mime type settings? the file is a phtml with html and a few php lines no customized mime. I was just able to reproduce it myself when editing html sections in a regular PHP file. Upgrading to P2. The exception is related to CLS migration I'll look at it. Can be either a bug of LanguageRegistry.getInstance().getLanguageByMimeType(mimeType) returning PHPLanguage for text/html mimetype or more likely an issue in ResultIterator resp. its SourceCache returning a ParserResult not generated by parser registered to ResultIterator.getSnapshot().getMimeType() mimetype. I'll add some debug messages. Any steps to reproduce are welcomed! debug code added in web-main#e37aeb86d5c1 *** Issue 161159 has been marked as a duplicate of this issue. *** Integrated into 'main-golden', will be available in build *200903260733* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/e37aeb86d5c1 User: Marek Fukala <mfukala@netbeans.org> Log: #161033 debug *** Issue 161167 has been marked as a duplicate of this issue. *** *** Issue 160754 has been marked as a duplicate of this issue. *** This issue happened to me and no IllegalStateException was thrown. Build: NetBeans IDE Dev (Build 20090327091525) VM: Java HotSpot(TM) 64-Bit Server VM, 1.6.0_07-b06-57, Java(TM) SE Runtime Environment, 1.6.0_07-b06-153 OS: Mac OS X, 10.5.6, x86_64 User Comments: typing in html document Stacktrace: java.lang.ClassCastException: org.netbeans.modules.css.gsf.api.CssParserResult cannot be cast to org.netbeans.modules.html.editor.gsf.HtmlParserResult at org.netbeans.modules.html.editor.gsf.HtmlSemanticAnalyzer.run(HtmlSemanticAnalyzer.java:89) at org.netbeans.modules.csl.editor.semantic.SemanticHighlighter.process(SemanticHighlighter.java:315) at org.netbeans.modules.csl.editor.semantic.SemanticHighlighter.access$000(SemanticHighlighter.java:80) at org.netbeans.modules.csl.editor.semantic.SemanticHighlighter$1.run(SemanticHighlighter.java:148) at org.netbeans.modules.csl.editor.semantic.SemanticHighlighter$1.run(SemanticHighlighter.java:157) at org.netbeans.modules.parsing.api.ParserManager$UserTaskAction.run(ParserManager.java:131) Created attachment 78989 [details]
stacktrace
hmm, that means that the CCE happens even if resultIterator.getSnapshot().getMimeType().equals(resultIterator.getParserResult().getSnapshot().getMimeType()); I wonder why the extra message is not logged: SemanticHiglighter:314: try { task.run(result, null); //here the CCE happens } catch (Exception ex) { LOG.log(Level.WARNING, "SemanticAnalyzer = " + task + "; Language = " + language + " (mimetype = " + language.getMimeType() + "; ParserResult = " + result + "(mimepath = " + result.getSnapshot().getMimePath() + ")", ex); } ??? this should log some more info when the CCE happens AFAIK. t mistakenly closed by encripted??? I just got a user report containing the recently added debug information: WARNING [org.netbeans.modules.html.editor.gsf.embedding.CssEmbeddingProvider]: Unexpected snapshot type: 'text/x-php5'; expecting 'text/html' WARNING [org.netbeans.modules.csl.hints.infrastructure.HintsTask] java.lang.ClassCastException: org.netbeans.modules.html.editor.gsf.HtmlParserResult cannot be cast to org.netbeans.modules.php.editor.parser.PHPParseResult at org.netbeans.modules.php.editor.verification.PHPHintsProvider.computeHin ts(PHPHintsProvider.java:133) ... Build: NetBeans IDE Dev (Build 200904010000) VM: Java HotSpot(TM) Client VM, 11.3-b02, Java(TM) SE Runtime Environment, 1.6.0_13-b03 OS: Windows XP, 5.1, x86 User Comments: Editing PHP file. To be honest, I dont know exactely what triggered this :-/ I only replaced double quotes for single quote on a line with error Stacktrace: org.netbeans.modules.parsing.spi.ParseException at org.netbeans.modules.parsing.impl.TaskProcessor.runUserTask(TaskProcessor.java:190) at org.netbeans.modules.parsing.api.ParserManager.parse(ParserManager.java:101) at org.netbeans.modules.csl.hints.infrastructure.HintsTask.run(HintsTask.java:85) at org.netbeans.modules.csl.hints.infrastructure.HintsTask.run(HintsTask.java:71) at org.netbeans.modules.parsing.impl.TaskProcessor$CompilationJob.run(TaskProcessor.java:681) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) Created attachment 79227 [details]
stacktrace
WARNUNG [org.netbeans.modules.csl.editor.semantic.SemanticHighlighter]: SemanticAnalyzer = org.netbeans.modules.php.editor.parser.SemanticAnalysis@1e9fcf8; Language = org.netbeans.modules.csl.core.Language@104ee8[text/x-php5 (mimetype = text/x-php5; ParserResult = org.netbeans.modules.html.editor.gsf.HtmlParserResult@df28d2(mimepath = MimePath[text/x-php5]) According to the logged debug messages it looks like the problem is that the HtmlParserResult.getSnapshot().getMimePath() returns (text/x-php5) instead of (.../text/html) There are also many warnings from both Css and Javascript embeddings providers complaining that the given snapshot is not of the expected type. Please not that the embeddings providers are registered to all mimetypes, but the factories creates EP instance only for text/html snapshot. So the assumption is that subsequent calls to EP.getEmbeddings(Snapshot s) will happen only for snapshot of the same (text/html) type. Please also note that most of the reports complains about text/x-php5 mimetype. The PhpEmbeddingProvider is registered to text/x-php5 mimetype and then the factory.create() method makes EP instances regardless on the given snapshot. Reassigning to Hanz since this looks like a race condition in parsing.api. Please looks the recent exception reports messages log, for example: http://statistics.netbeans.org/exceptions/messageslog?id=185229 The issue is random, but already we have 102 duplicate exception reports. Build: NetBeans IDE Dev (Build 200904011705) VM: Java HotSpot(TM) 64-Bit Server VM, 11.0-b16, Java(TM) SE Runtime Environment, 1.6.0_11-b03 OS: Windows Vista, 6.0, amd64 User Comments: Editing a comment in HTML file Stacktrace: java.lang.ClassCastException: org.netbeans.modules.css.gsf.api.CssParserResult cannot be cast to org.netbeans.modules.html.editor.gsf.HtmlParserResult at org.netbeans.modules.html.editor.gsf.HtmlSemanticAnalyzer.run(HtmlSemanticAnalyzer.java:89) at org.netbeans.modules.csl.editor.semantic.SemanticHighlighter.process(SemanticHighlighter.java:315) at org.netbeans.modules.csl.editor.semantic.SemanticHighlighter.access$000(SemanticHighlighter.java:80) at org.netbeans.modules.csl.editor.semantic.SemanticHighlighter$1.run(SemanticHighlighter.java:148) at org.netbeans.modules.csl.editor.semantic.SemanticHighlighter$1.run(SemanticHighlighter.java:157) at org.netbeans.modules.parsing.api.ParserManager$UserTaskAction.run(ParserManager.java:131) Created attachment 79478 [details]
stacktrace
Build: NetBeans IDE Dev (Build 200904011705) VM: Java HotSpot(TM) 64-Bit Server VM, 11.0-b16, Java(TM) SE Runtime Environment, 1.6.0_11-b03 OS: Windows Vista, 6.0, amd64 User Comments: Editing comment in html file Stacktrace: org.netbeans.modules.parsing.spi.ParseException at org.netbeans.modules.parsing.impl.TaskProcessor.runUserTask(TaskProcessor.java:190) at org.netbeans.modules.parsing.api.ParserManager.parse(ParserManager.java:101) at org.netbeans.modules.csl.editor.fold.GsfFoldManager$JavaElementFoldTask.gsfFoldScan(GsfFoldManager.java:377) at org.netbeans.modules.csl.editor.fold.GsfFoldManager$JavaElementFoldTask.run(GsfFoldManager.java:353) at org.netbeans.modules.csl.editor.fold.GsfFoldManager$JavaElementFoldTask.run(GsfFoldManager.java:298) at org.netbeans.modules.parsing.impl.TaskProcessor$CompilationJob.run(TaskProcessor.java:681) Created attachment 79480 [details]
stacktrace
*** Issue 161909 has been marked as a duplicate of this issue. *** *** Issue 161909 has been marked as a duplicate of this issue. *** *** Issue 161909 has been marked as a duplicate of this issue. *** *** Issue 161958 has been marked as a duplicate of this issue. *** Wow, lots of duplicates, I'd say this is a P1. Build: NetBeans IDE Dev (Build 090406) VM: Java HotSpot(TM) Client VM, 1.5.0_16-b02, Java(TM) 2 Runtime Environment, Standard Edition, 1.5.0_16-b02 OS: Linux, 2.6.24-23-generic, i386 User Comments: Stacktrace: java.lang.ClassCastException: org.netbeans.modules.html.editor.gsf.HtmlParserResult at org.netbeans.modules.php.editor.parser.SemanticAnalysis.run(SemanticAnalysis.java:92) at org.netbeans.modules.csl.editor.semantic.SemanticHighlighter.process(SemanticHighlighter.java:315) at org.netbeans.modules.csl.editor.semantic.SemanticHighlighter.access$000(SemanticHighlighter.java:80) at org.netbeans.modules.csl.editor.semantic.SemanticHighlighter$1.run(SemanticHighlighter.java:148) at org.netbeans.modules.csl.editor.semantic.SemanticHighlighter$1.run(SemanticHighlighter.java:157) at org.netbeans.modules.parsing.api.ParserManager$UserTaskAction.run(ParserManager.java:129) Created attachment 79548 [details]
stacktrace
I can not reproduce it. Yes, there are many duplicates. On the other hand - its RANDOM, no data loss. So, P2 is more accurate, I think. *** Issue 161014 has been marked as a duplicate of this issue. *** This issue has already 250 duplicates see http://statistics.netbeans.org/exceptions/detail.do?id=148002 Happens very often to me. I'm ready to run NB with logging enabled and I'm sure I will be able to trap it very soon again. So, is it possible to provide some logging aiming to find the cause? I have found reproducible usecase, so I will fix it soon. Thanks for your offer. looks like its fixed in 0fcec879498e *** Issue 161372 has been marked as a duplicate of this issue. *** *** Issue 161855 has been marked as a duplicate of this issue. *** Integrated into 'main-golden', will be available in build *200904100201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/0fcec879498e User: Jan Jancura <jjancura@netbeans.org> Log: #161033:[67cat] ClassCastException: org.netbeans.modules.html.editor *** Issue 162483 has been marked as a duplicate of this issue. *** Build: NetBeans IDE Dev (Build 200903231401) VM: Java HotSpot(TM) Client VM, 1.5.0_16-133, Java(TM) 2 Runtime Environment, Standard Edition, 1.5.0_16-b06-284 OS: Mac OS X, 10.5.6, i386 User Comments: Stacktrace: org.netbeans.modules.parsing.spi.ParseException at org.netbeans.modules.parsing.impl.TaskProcessor.runUserTask(TaskProcessor.java:190) at org.netbeans.modules.parsing.api.ParserManager.parse(ParserManager.java:98) at org.netbeans.modules.csl.hints.infrastructure.HintsTask.run(HintsTask.java:85) at org.netbeans.modules.csl.hints.infrastructure.HintsTask.run(HintsTask.java:71) at org.netbeans.modules.parsing.impl.TaskProcessor$CompilationJob.run(TaskProcessor.java:681) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417) Created attachment 80411 [details]
stacktrace
Build: NetBeans IDE Dev (Build 200904011705) VM: Java HotSpot(TM) 64-Bit Server VM, 1.6.0_07-b06-57, Java(TM) SE Runtime Environment, 1.6.0_07-b06-153 OS: Mac OS X, 10.5.6, x86_64 User Comments: Stacktrace: java.lang.ClassCastException: org.netbeans.modules.css.gsf.api.CssParserResult cannot be cast to org.netbeans.modules.html.editor.gsf.HtmlParserResult at org.netbeans.modules.html.editor.gsf.HtmlSemanticAnalyzer.run(HtmlSemanticAnalyzer.java:89) at org.netbeans.modules.csl.editor.semantic.SemanticHighlighter.process(SemanticHighlighter.java:315) at org.netbeans.modules.csl.editor.semantic.SemanticHighlighter.access$000(SemanticHighlighter.java:80) at org.netbeans.modules.csl.editor.semantic.SemanticHighlighter$1.run(SemanticHighlighter.java:148) at org.netbeans.modules.csl.editor.semantic.SemanticHighlighter$1.run(SemanticHighlighter.java:157) at org.netbeans.modules.parsing.api.ParserManager$UserTaskAction.run(ParserManager.java:131) Created attachment 80850 [details]
stacktrace
*** Issue 165496 has been marked as a duplicate of this issue. *** |