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 127778 - Random exceptions when opening multiple htmls/jsps during startup
Summary: Random exceptions when opening multiple htmls/jsps during startup
Status: RESOLVED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Marek Fukala
URL:
Keywords: RANDOM
Depends on:
Blocks:
 
Reported: 2008-02-19 17:56 UTC by Marek Fukala
Modified: 2008-03-07 13:07 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 Marek Fukala 2008-02-19 17:56:16 UTC
Caused: java.lang.IllegalArgumentException: languagePath cannot be null
	at org.netbeans.lib.lexer.TokenHierarchyOperation.tokenSequenceList(TokenHierarchyOperation.java:340)
	at org.netbeans.api.lexer.TokenHierarchy.tokenSequenceList(TokenHierarchy.java:226)
	at org.netbeans.modules.html.editor.gsf.embedding.HtmlModel.extractHtml(HtmlModel.java:176)
	at org.netbeans.modules.html.editor.gsf.embedding.HtmlModel.getHtmlCode(HtmlModel.java:136)
	at org.netbeans.modules.html.editor.gsf.embedding.HtmlTranslatedSource.getSource(HtmlTranslatedSource.java:67)
	at org.netbeans.napi.gsfret.source.Source.moveToPhase(Source.java:880)
	at org.netbeans.napi.gsfret.source.Source$CompilationJob.run(Source.java:1206)
	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 java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
[catch] at java.lang.Thread.run(Thread.java:619)

Caused: java.lang.NullPointerException
	at org.netbeans.lib.lexer.TextLexerInputOperation.<init>(TextLexerInputOperation.java:71)
	at org.netbeans.lib.lexer.batch.TextTokenList.createLexerInputOperation(TextTokenList.java:75)
	at org.netbeans.lib.lexer.batch.BatchTokenList.init(BatchTokenList.java:121)
	at org.netbeans.lib.lexer.batch.BatchTokenList.tokenOrEmbeddingContainerImpl(BatchTokenList.java:181)
	at org.netbeans.lib.lexer.batch.BatchTokenList.tokenOrEmbeddingContainer(BatchTokenList.java:176)
	at org.netbeans.api.lexer.TokenSequence.moveNext(TokenSequence.java:405)
	at org.netbeans.editor.ext.html.parser.SyntaxParser.parseDocument(SyntaxParser.java:354)
	at org.netbeans.editor.ext.html.parser.SyntaxParser.parseImmutableSource(SyntaxParser.java:169)
	at org.netbeans.modules.html.editor.gsf.HtmlGSFParser.parseFiles(HtmlGSFParser.java:75)
	at org.netbeans.napi.gsfret.source.Source.moveToPhase(Source.java:883)
	at org.netbeans.napi.gsfret.source.Source$CompilationJob.run(Source.java:1206)
	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 java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
[catch] at java.lang.Thread.run(Thread.java:619)
Comment 1 Marek Fukala 2008-02-20 14:45:00 UTC
Not happening often, lowering priority.
Comment 2 Marek Fukala 2008-03-07 11:23:25 UTC
looks like SyntaxParser.create(buffer) in HtmlGSFParser passed null as the argument.

The buffer is got from Job.reader.read(file).

Likely the first exception caused the virtual source not to be created and hence the second problem appeared.

It looks like TokenHierarchy for the JSP document returned a list of possible language paths from TH.languagePaths()
which didn't contain any html path. Since the paths are static AFAIK, the TokenHierarchy hasn't been active already.
This is strange since the TH is created under readlock. Can the TH be inactive during the readlock in such case???

I'll add a check for the TH activity and test the found html path to null.

fixed in revision 811ba2019848


Comment 3 Miloslav Metelka 2008-03-07 12:19:15 UTC
Marek, you're right, the TH.languagePaths() returns Collections.emptySet() when TH is inactive. I'll change that - issue
129534.
Comment 4 Miloslav Metelka 2008-03-07 13:07:05 UTC
Sorry, I was wrong the TH.languagePaths() SHOULD attempt TH activation. I've added an extra test to verify that (see
issue 129534).