oracle / javavscode

Java platform support for Visual Studio Code for full featured Java development (edit-compile-debug & test cycle)
Apache License 2.0
231 stars 31 forks source link

XML formatter fails #222

Closed anthonyvdotbe closed 4 months ago

anthonyvdotbe commented 4 months ago

VS Code 1.91.1, extension v22.1.1

Opening a POM file gives the error below. This seems the same issue as in https://github.com/oracle/javavscode/issues/24, which was meant to be fixed by https://github.com/apache/netbeans/pull/6631 So somehow the bug is back.

SEVERE [org.openide.util.RequestProcessor]: Error in RequestProcessor org.netbeans.modules.java.lsp.server.protocol.TextDocumentServiceImpl$$Lambda/0x000001949063df30
java.lang.ClassCastException: class org.openide.text.FilterDocument cannot be cast to class org.netbeans.editor.BaseDocument (org.openide.text.FilterDocument is in unnamed module of loader org.netbeans.StandardModule$OneModuleClassLoader @569b714a; org.netbeans.editor.BaseDocument is in unnamed module of loader org.netbeans.StandardModule$OneModuleClassLoader @6f9f0501)
    at org.netbeans.modules.maven.hints.pom.MavenPOMParser.parse(MavenPOMParser.java:79)
    at org.netbeans.modules.parsing.impl.TaskProcessor.callParse(TaskProcessor.java:598)
    at org.netbeans.modules.parsing.impl.SourceCache.getResult(SourceCache.java:230)
    at org.netbeans.modules.parsing.api.ResultIterator.getParserResult(ResultIterator.java:115)
    at org.netbeans.modules.maven.hints.pom.LspMavenErrorProvider$T.run(LspMavenErrorProvider.java:63)
    at org.netbeans.modules.parsing.impl.TaskProcessor.callUserTask(TaskProcessor.java:586)
    at org.netbeans.modules.parsing.api.ParserManager$UserTaskAction.run(ParserManager.java:197)
    at org.netbeans.modules.parsing.api.ParserManager$UserTaskAction.run(ParserManager.java:180)
    at org.netbeans.modules.parsing.impl.TaskProcessor$2.call(TaskProcessor.java:181)
    at org.netbeans.modules.parsing.impl.TaskProcessor$2.call(TaskProcessor.java:178)
    at org.netbeans.modules.masterfs.filebasedfs.utils.FileChangedManager.priorityIO(FileChangedManager.java:153)
    at org.netbeans.modules.masterfs.providers.ProvidedExtensions.priorityIO(ProvidedExtensions.java:335)
    at org.netbeans.modules.parsing.nb.DataObjectEnvFactory.runPriorityIO(DataObjectEnvFactory.java:118)
    at org.netbeans.modules.parsing.impl.Utilities.runPriorityIO(Utilities.java:67)
    at org.netbeans.modules.parsing.impl.TaskProcessor.runUserTask(TaskProcessor.java:178)
Caused: org.netbeans.modules.parsing.spi.ParseException
    at org.netbeans.modules.parsing.impl.TaskProcessor.runUserTask(TaskProcessor.java:186)
    at org.netbeans.modules.parsing.api.ParserManager.parse(ParserManager.java:83)
    at org.netbeans.modules.maven.hints.pom.LspMavenErrorProvider.computeErrors(LspMavenErrorProvider.java:140)
Caused: java.lang.IllegalStateException: Parsing failed
    at org.netbeans.modules.maven.hints.pom.LspMavenErrorProvider.computeErrors(LspMavenErrorProvider.java:144)
    at org.netbeans.modules.java.lsp.server.protocol.TextDocumentServiceImpl.lambda$computeDiags$46(TextDocumentServiceImpl.java:2004)
    at java.base/java.util.stream.ReferencePipeline$7$1FlatMap.accept(ReferencePipeline.java:289)
    at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1709)
    at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:570)
    at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:560)
    at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
    at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:265)
    at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:727)
    at org.netbeans.modules.java.lsp.server.protocol.TextDocumentServiceImpl.computeDiags(TextDocumentServiceImpl.java:2004)
    at org.netbeans.modules.java.lsp.server.protocol.TextDocumentServiceImpl.lambda$runDiagnosticTasks$43(TextDocumentServiceImpl.java:1907)
    at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1420)
    at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:45)
    at org.openide.util.lookup.Lookups.executeWith(Lookups.java:287)
[catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2035)
    at org.ejava.lang.ClassCastException: class org.openide.text.FilterDocument cannot be cast to class org.netbeans.editor.BaseDocument (org.openide.text.FilterDocument is in unnamed module of loader org.netbeans.StandardModule$OneModuleClassLoader @569b714a; org.netbeans.editor.BaseDocument is in unnamed module of loader org.netbeans.StandardModule$OneModuleClassLoader @6f9f0501)
    at org.netbeans.modules.maven.hints.pom.MavenPOMParser.parse(MavenPOMParser.java:79)
    at org.netbeans.modules.parsing.impl.TaskProcessor.callParse(TaskProcessor.java:598)
    at org.netbeans.modules.parsing.impl.SourceCache.getResult(SourceCache.java:230)
    at org.netbeans.modules.parsing.api.ResultIterator.getParserResult(ResultIterator.java:115)
    at org.netbeans.modules.maven.hints.pom.LspMavenErrorProvider$T.run(LspMavenErrorProvider.java:63)
    at org.netbeans.modules.parsing.impl.TaskProcessor.callUserTask(TaskProcessor.java:586)
    at org.netbeans.modules.parsing.api.ParserManager$UserTaskAction.run(ParserManager.java:197)
    at org.netbeans.modules.parsing.api.ParserManager$UserTaskAction.run(ParserManager.java:180)
    at org.netbeans.modules.parsing.impl.TaskProcessor$2.call(TaskProcessor.java:181)
    at org.netbeans.modules.parsing.impl.TaskProcessor$2.call(TaskProcessor.java:178)
    at org.netbeans.modules.masterfs.filebasedfs.utils.FileChangedManager.priorityIO(FileChangedManager.java:153)
    at org.netbeans.modules.masterfs.providers.ProvidedExtensions.priorityIO(ProvidedExtensions.java:335)
    at org.netbeans.modules.parsing.nb.DataObjectEnvFactory.runPriorityIO(DataObjectEnvFactory.java:118)
    at org.netbeans.modules.parsing.impl.Utilities.runPriorityIO(Utilities.java:67)
    at org.netbeans.modules.parsing.impl.TaskProcessor.runUserTask(TaskProcessor.java:178)
Caused: org.netbeans.modules.parsing.spi.ParseException
    at org.netbeans.modules.parsing.impl.TaskProcessor.runUserTask(TaskProcessor.java:186)
    at org.netbeans.modules.parsing.api.ParserManager.parse(ParserManager.java:83)
    at org.netbeans.modules.maven.hints.pom.LspMavenErrorProvider.computeErrors(LspMavenErrorProvider.java:140)
Caused: java.lang.IllegalStateException: Parsing failed
    at org.netbeans.modules.maven.hints.pom.LspMavenErrorProvider.computeErrors(LspMavenErrorProvider.java:144)
    at org.netbeans.modules.java.lsp.server.protocol.TextDocumentServiceImpl.lambda$computeDiags$46(TextDocumentServiceImpl.java:2004)
    at java.base/java.util.stream.ReferencePipeline$7$1FlatMap.accept(ReferencePipeline.java:289)
    at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1709)
    at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:570)
    at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:560)
    at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
    at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:265)
    at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:727)
    at org.netbeans.modules.java.lsp.server.protocol.TextDocumentServiceImpl.computeDiags(TextDocumentServiceImpl.java:2004)
    at org.netbeans.modules.java.lsp.server.protocol.TextDocumentServiceImpl.lambda$runDiagnosticTasks$43(TextDocumentServiceImpl.java:1907)
Achal1607 commented 4 months ago

Duplicate of #185