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

kotlin-language-server crashes during initialization #23

Open
ilanpillemer opened this issue Oct 25, 2019 · 1 comment
Open

kotlin-language-server crashes during initialization #23

ilanpillemer opened this issue Oct 25, 2019 · 1 comment

Comments

@ilanpillemer
Copy link
Contributor

Does acme-lsp work with JSON-RPC communications with a lsp-server?
I am trying to get it to work with https://github.com/fwcd/kotlin-language-server
But I get errors like the below.

2019/10/25 13:55:18 log: LSP Error: client Internal error: java.lang.reflect.InvocationTargetException 2019/10/25 13:55:18 log: LSP Error: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException 2019/10/25 13:55:18 log: LSP Error: at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:67) 2019/10/25 13:55:18 log: LSP Error: at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.request(GenericEndpoint.java:120) 2019/10/25 13:55:18 log: LSP Error: at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleRequest(RemoteEndpoint.java:261) 2019/10/25 13:55:18 log: LSP Error: at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:190) 2019/10/25 13:55:18 log: LSP Error: at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:192) 2019/10/25 13:55:18 log: LSP Error: at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:94) 2019/10/25 13:55:18 log: LSP Error: at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:113) 2019/10/25 13:55:18 log: LSP Error: at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 2019/10/25 13:55:18 log: LSP Error: at java.util.concurrent.FutureTask.run(FutureTask.java:266) 2019/10/25 13:55:18 log: LSP Error: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) 2019/10/25 13:55:18 log: LSP Error: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) 2019/10/25 13:55:18 log: LSP Error: at java.lang.Thread.run(Thread.java:748) 2019/10/25 13:55:18 log: LSP Error: Caused by: java.lang.reflect.InvocationTargetException 2019/10/25 13:55:18 log: LSP Error: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 2019/10/25 13:55:18 log: LSP Error: at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 2019/10/25 13:55:18 log: LSP Error: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 2019/10/25 13:55:18 log: LSP Error: at java.lang.reflect.Method.invoke(Method.java:498) 2019/10/25 13:55:18 log: LSP Error: at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:65) 2019/10/25 13:55:18 log: LSP Error: ... 11 more 2019/10/25 13:55:18 log: LSP Error: Caused by: java.lang.NullPointerException 2019/10/25 13:55:18 log: LSP Error: at sun.nio.fs.UnixFileSystem$3.matches(UnixFileSystem.java:310) 2019/10/25 13:55:18 log: LSP Error: at org.javacs.kt.SourceFilesKt$findSourceFiles$1.test(SourceFiles.kt:212) 2019/10/25 13:55:18 log: LSP Error: at org.javacs.kt.SourceFilesKt$findSourceFiles$1.test(SourceFiles.kt) 2019/10/25 13:55:18 log: LSP Error: at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:174) 2019/10/25 13:55:18 log: LSP Error: at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) 2019/10/25 13:55:18 log: LSP Error: at java.util.Iterator.forEachRemaining(Iterator.java:116) 2019/10/25 13:55:18 log: LSP Error: at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801) 2019/10/25 13:55:18 log: LSP Error: at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482) 2019/10/25 13:55:18 log: LSP Error: at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472) 2019/10/25 13:55:18 log: LSP Error: at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) 2019/10/25 13:55:18 log: LSP Error: at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) 2019/10/25 13:55:18 log: LSP Error: at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:566) 2019/10/25 13:55:18 log: LSP Error: at org.javacs.kt.SourceFilesKt.findSourceFiles(SourceFiles.kt:213) 2019/10/25 13:55:18 log: LSP Error: at org.javacs.kt.SourceFilesKt.access$findSourceFiles(SourceFiles.kt:1) 2019/10/25 13:55:18 log: LSP Error: at org.javacs.kt.SourceFiles.addWorkspaceRoot(SourceFiles.kt:145) 2019/10/25 13:55:18 log: LSP Error: at org.javacs.kt.KotlinLanguageServer.initialize(KotlinLanguageServer.kt:75) 2019/10/25 13:55:18 log: LSP Error: ... 16 more 2019/10/25 13:55:18 didOpen failed in file manager: failed to connect to language server ["kotlin-language-server"]: initialize failed: Internal error. 2019/10/25 13:56:58 log: LSP Error: client Internal error: java.lang.reflect.InvocationTargetException 2019/10/25 13:56:58 log: LSP Error: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException 2019/10/25 13:56:58 log: LSP Error: at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:67) 2019/10/25 13:56:58 log: LSP Error: at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.request(GenericEndpoint.java:120) 2019/10/25 13:56:58 log: LSP Error: at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleRequest(RemoteEndpoint.java:261) 2019/10/25 13:56:58 log: LSP Error: at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:190) 2019/10/25 13:56:58 log: LSP Error: at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:192) 2019/10/25 13:56:58 log: LSP Error: at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:94) 2019/10/25 13:56:58 log: LSP Error: at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:113) 2019/10/25 13:56:58 log: LSP Error: at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 2019/10/25 13:56:58 log: LSP Error: at java.util.concurrent.FutureTask.run(FutureTask.java:266) 2019/10/25 13:56:58 log: LSP Error: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) 2019/10/25 13:56:58 log: LSP Error: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) 2019/10/25 13:56:58 log: LSP Error: at java.lang.Thread.run(Thread.java:748) 2019/10/25 13:56:58 log: LSP Error: Caused by: java.lang.reflect.InvocationTargetException 2019/10/25 13:56:58 log: LSP Error: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 2019/10/25 13:56:58 log: LSP Error: at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 2019/10/25 13:56:58 log: LSP Error: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 2019/10/25 13:56:58 log: LSP Error: at java.lang.reflect.Method.invoke(Method.java:498) 2019/10/25 13:56:58 log: LSP Error: at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:65) 2019/10/25 13:56:58 log: LSP Error: ... 11 more 2019/10/25 13:56:58 log: LSP Error: Caused by: java.lang.NullPointerException 2019/10/25 13:56:58 log: LSP Error: at sun.nio.fs.UnixFileSystem$3.matches(UnixFileSystem.java:310) 2019/10/25 13:56:58 log: LSP Error: at org.javacs.kt.SourceFilesKt$findSourceFiles$1.test(SourceFiles.kt:212) 2019/10/25 13:56:58 log: LSP Error: at org.javacs.kt.SourceFilesKt$findSourceFiles$1.test(SourceFiles.kt) 2019/10/25 13:56:58 log: LSP Error: at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:174) 2019/10/25 13:56:58 log: LSP Error: at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) 2019/10/25 13:56:58 log: LSP Error: at java.util.Iterator.forEachRemaining(Iterator.java:116) 2019/10/25 13:56:58 log: LSP Error: at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801) 2019/10/25 13:56:58 log: LSP Error: at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482) 2019/10/25 13:56:58 log: LSP Error: at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472) 2019/10/25 13:56:58 log: LSP Error: at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) 2019/10/25 13:56:58 log: LSP Error: at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) 2019/10/25 13:56:58 log: LSP Error: at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:566) 2019/10/25 13:56:58 log: LSP Error: at org.javacs.kt.SourceFilesKt.findSourceFiles(SourceFiles.kt:213) 2019/10/25 13:56:58 log: LSP Error: at org.javacs.kt.SourceFilesKt.access$findSourceFiles(SourceFiles.kt:1) 2019/10/25 13:56:58 log: LSP Error: at org.javacs.kt.SourceFiles.addWorkspaceRoot(SourceFiles.kt:145) 2019/10/25 13:56:58 log: LSP Error: at org.javacs.kt.KotlinLanguageServer.initialize(KotlinLanguageServer.kt:75) 2019/10/25 13:56:58 log: LSP Error: ... 16 more 2019/10/25 13:56:58 : DidChange: unknown language server for URI "file:///Users/ilanpillemer/Repos/bxbdigital/model-language/src/main/kotlin/DslInterpreter.kt" 2019/10/25 13:56:59 log: LSP Error: client Internal error: java.lang.reflect.InvocationTargetException 2019/10/25 13:56:59 log: LSP Error: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException 2019/10/25 13:56:59 log: LSP Error: at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:67) 2019/10/25 13:56:59 log: LSP Error: at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.request(GenericEndpoint.java:120) 2019/10/25 13:56:59 log: LSP Error: at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleRequest(RemoteEndpoint.java:261) 2019/10/25 13:56:59 log: LSP Error: at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:190) 2019/10/25 13:56:59 log: LSP Error: at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:192) 2019/10/25 13:56:59 log: LSP Error: at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:94) 2019/10/25 13:56:59 log: LSP Error: at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:113) 2019/10/25 13:56:59 log: LSP Error: at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 2019/10/25 13:56:59 log: LSP Error: at java.util.concurrent.FutureTask.run(FutureTask.java:266) 2019/10/25 13:56:59 log: LSP Error: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) 2019/10/25 13:56:59 log: LSP Error: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) 2019/10/25 13:56:59 log: LSP Error: at java.lang.Thread.run(Thread.java:748) 2019/10/25 13:56:59 log: LSP Error: Caused by: java.lang.reflect.InvocationTargetException 2019/10/25 13:56:59 log: LSP Error: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 2019/10/25 13:56:59 log: LSP Error: at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 2019/10/25 13:56:59 log: LSP Error: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 2019/10/25 13:56:59 log: LSP Error: at java.lang.reflect.Method.invoke(Method.java:498) 2019/10/25 13:56:59 log: LSP Error: at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:65) 2019/10/25 13:56:59 log: LSP Error: ... 11 more 2019/10/25 13:56:59 log: LSP Error: Caused by: java.lang.NullPointerException 2019/10/25 13:56:59 log: LSP Error: at sun.nio.fs.UnixFileSystem$3.matches(UnixFileSystem.java:310) 2019/10/25 13:56:59 log: LSP Error: at org.javacs.kt.SourceFilesKt$findSourceFiles$1.test(SourceFiles.kt:212) 2019/10/25 13:56:59 log: LSP Error: at org.javacs.kt.SourceFilesKt$findSourceFiles$1.test(SourceFiles.kt) 2019/10/25 13:56:59 log: LSP Error: at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:174) 2019/10/25 13:56:59 log: LSP Error: at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) 2019/10/25 13:56:59 log: LSP Error: at java.util.Iterator.forEachRemaining(Iterator.java:116) 2019/10/25 13:56:59 log: LSP Error: at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801) 2019/10/25 13:56:59 log: LSP Error: at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482) 2019/10/25 13:56:59 log: LSP Error: at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472) 2019/10/25 13:56:59 log: LSP Error: at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) 2019/10/25 13:56:59 log: LSP Error: at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) 2019/10/25 13:56:59 log: LSP Error: at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:566) 2019/10/25 13:56:59 log: LSP Error: at org.javacs.kt.SourceFilesKt.findSourceFiles(SourceFiles.kt:213) 2019/10/25 13:56:59 log: LSP Error: at org.javacs.kt.SourceFilesKt.access$findSourceFiles(SourceFiles.kt:1) 2019/10/25 13:56:59 log: LSP Error: at org.javacs.kt.SourceFiles.addWorkspaceRoot(SourceFiles.kt:145) 2019/10/25 13:56:59 log: LSP Error: at org.javacs.kt.KotlinLanguageServer.initialize(KotlinLanguageServer.kt:75) 2019/10/25 13:56:59 log: LSP Error: ... 16 more

@fhs
Copy link
Collaborator

fhs commented Oct 25, 2019

I certainly want to get acme-lsp working with all LSP servers that follow the LSP spec. It just hasn't been tested with many servers.

In this case, it looks like kotlin-language-server is crashing during initialization. Have you tested this server with VSCode or some other editor? Does it work?

Also, do you know if there is a way for kotlin-language-server to print json-rpc trace on stderr? I should really add support for tracing in acme-lsp, for servers that can't do tracing.

The crash:

$ acme-lsp -v -server '\.kt$:/tmp/fhs.Downloads/server/bin/kotlin-language-server'
2019/10/25 12:01:59 log: LSP Info: main      Connected to client
2019/10/25 12:01:59 log: LSP Info: client    Adding workspace file:/// to source path
Oct 25, 2019 12:01:59 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.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:192)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:94)
	at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:99)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:514)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:844)
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:564)
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:65)
	... 11 more
Caused by: java.lang.NullPointerException
	at java.base/sun.nio.fs.UnixFileSystem$3.matches(UnixFileSystem.java:309)
	at org.javacs.kt.SourceFilesKt$findSourceFiles$1.test(SourceFiles.kt:196)
	at org.javacs.kt.SourceFilesKt$findSourceFiles$1.test(SourceFiles.kt)
	at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:176)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
	at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)
	at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
	at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578)
	at org.javacs.kt.SourceFilesKt.findSourceFiles(SourceFiles.kt:197)
	at org.javacs.kt.SourceFilesKt.access$findSourceFiles(SourceFiles.kt:1)
	at org.javacs.kt.SourceFiles.addWorkspaceRoot(SourceFiles.kt:129)
	at org.javacs.kt.KotlinLanguageServer.initialize(KotlinLanguageServer.kt:70)
	... 16 more

2019/10/25 12:01:59 log: LSP Error: client    Internal error: java.lang.reflect.InvocationTargetException
2019/10/25 12:01:59 didOpen failed in file manager: failed to connect to language server ["/tmp/fhs.Downloads/server/bin/kotlin-language-server"]: initialize failed: Internal error.

@fhs fhs changed the title JSON-RPC? kotlin-language-server crashes during initialization Nov 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants