Clicking on a valid pom.xml in a Java project generates the following exception in the language server:
[Error - 5:28:55 PM] Request textDocument/codeAction failed.
Message: Internal error.
Code: -32603
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:67)
at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.request(GenericEndpoint.java:120)
at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleRequest(RemoteEndpoint.java:261)
at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:190)
at org.netbeans.modules.java.lsp.server.protocol.Server$ConsumeWithLookup$1.lambda$consume$0(Server.java:316)
at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:45)
at org.openide.util.lookup.Lookups.executeWith(Lookups.java:287)
at org.netbeans.modules.java.lsp.server.protocol.Server$ConsumeWithLookup$1.consume(Server.java:314)
at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:194)
at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:94)
at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:113)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:118)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:65)
... 15 more
Caused by: 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.computeDiags(TextDocumentServiceImpl.java:2032)
at org.netbeans.modules.java.lsp.server.protocol.TextDocumentServiceImpl.codeAction(TextDocumentServiceImpl.java:1001)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
... 17 more
Caused by: 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)
... 20 more
Caused by: 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 @64507e76; org.netbeans.editor.BaseDocument is in unnamed module of loader org.netbeans.StandardModule$OneModuleClassLoader @c57b167)
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:132)
at org.netbeans.modules.parsing.api.ParserManager$UserTaskAction.run(ParserManager.java:116)
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)
... 22 more
Clicking on a valid
pom.xml
in a Java project generates the following exception in the language server: