Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPE in XMLTextDocumentService.computeDOMAsync #957

Closed
apupier opened this issue Jan 7, 2021 · 1 comment · Fixed by #1026
Closed

NPE in XMLTextDocumentService.computeDOMAsync #957

apupier opened this issue Jan 7, 2021 · 1 comment · Fixed by #1026
Assignees
Labels
bug Something isn't working
Milestone

Comments

@apupier
Copy link
Contributor

apupier commented Jan 7, 2021

spotted in log:

Jan 07, 2021 1:55:18 PM org.eclipse.lsp4j.jsonrpc.RemoteEndpoint fallbackResponseError
SEVERE: Internal error: java.lang.reflect.InvocationTargetException
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.eclipse.lemminx.commons.ParentProcessWatcher.lambda$apply$0(ParentProcessWatcher.java:143)
	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:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.reflect.InvocationTargetException
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:65)
	... 12 more
Caused by: java.lang.NullPointerException
	at org.eclipse.lemminx.XMLTextDocumentService.computeDOMAsync(XMLTextDocumentService.java:546)
	at org.eclipse.lemminx.XMLTextDocumentService.foldingRange(XMLTextDocumentService.java:316)
	... 17 more

I do not have steps to reproduce.
I'm using org.eclipse.wildwebdeveloper.xml 0.9.1.202007231627

@angelozerr
Copy link
Contributor

Indeed I noticed this problem, but it occurs only in WWD (not in vscode).

To reproduce the problem it's easy, you open a XML file and you should see this error (sometimes).

The main reason is that LSP foldingRange request is called BEFORE the LSP didOpen. LSP4E folding reconcilier is processed before the didOpen //cc @mickaelistria .

We should take care of this NPE like other language server like JSON in vscode https://github.com/vscode-langservers/vscode-json-languageserver/blob/a24ff2be8707c1a9c82a699db1033de6c7215f45/src/jsonServer.ts#L464

@angelozerr angelozerr self-assigned this May 6, 2021
@datho7561 datho7561 self-assigned this May 6, 2021
datho7561 added a commit to datho7561/lemminx that referenced this issue May 10, 2021
Closees eclipse#957

Signed-off-by: David Thompson <davthomp@redhat.com>
datho7561 added a commit to datho7561/lemminx that referenced this issue May 10, 2021
Closes eclipse#957

Signed-off-by: David Thompson <davthomp@redhat.com>
datho7561 added a commit to datho7561/lemminx that referenced this issue May 11, 2021
Closes eclipse#957

Signed-off-by: David Thompson <davthomp@redhat.com>
angelozerr pushed a commit that referenced this issue May 11, 2021
Closes #957

Signed-off-by: David Thompson <davthomp@redhat.com>
@angelozerr angelozerr added this to the 0.17.0 milestone May 11, 2021
@angelozerr angelozerr added the bug Something isn't working label May 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants