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

Error when supplying non-object values to initializationOptions #65

Closed
jcs090218 opened this issue Apr 3, 2021 · 6 comments
Closed
Assignees
Labels
1-bug 🐛 Issue type: Bug report (something isn't working as expected) 2-confirmed Issue status: Confirmed, reproducible bug in LTeX 3-fixed Issue resolution: Issue has been fixed on the develop branch
Milestone

Comments

@jcs090218
Copy link

Hi, I am trying to create a Emacs plugin for this language server. I am currently getting this error to get the server up and running.

Apr 04, 2021 2:06:22 AM org.bsplines.ltexls.server.LtexLanguageServer initialize
INFO: ltex-ls 10.0.0 - initializing...
Apr 04, 2021 2:06:22 AM org.bsplines.ltexls.server.LtexLanguageServer initialize
WARNING: clientSupportsWorkDoneProgress = true
Apr 04, 2021 2:06:22 AM 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: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:1130)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
	at java.base/java.lang.Thread.run(Thread.java:832)
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.ClassCastException: class com.google.gson.JsonNull cannot be cast to class com.google.gson.JsonObject (com.google.gson.JsonNull and com.google.gson.JsonObject are in unnamed module of loader 'app')
	at org.bsplines.ltexls.server.LtexLanguageServer.initialize(LtexLanguageServer.java:77)
	... 16 more
@jcs090218 jcs090218 added the 1-question ❓ Issue type: General or specific question about LTeX label Apr 3, 2021
@valentjn valentjn added 1-bug 🐛 Issue type: Bug report (something isn't working as expected) 2-confirmed Issue status: Confirmed, reproducible bug in LTeX and removed 1-question ❓ Issue type: General or specific question about LTeX labels Apr 3, 2021
@valentjn valentjn self-assigned this Apr 3, 2021
@valentjn valentjn added this to the 11.0.0 milestone Apr 3, 2021
@valentjn valentjn changed the title [Question] Error while starting up Error when supplying non-object values to initializationOptions Apr 3, 2021
@valentjn
Copy link
Owner

valentjn commented Apr 3, 2021

The problem was that LTEX LS expected the value of initializationOptions during the initialize request either to be missing or to be a JSON object, but it seems to be given null according to the stack trace (which is a valid value according to the LSP spec). As a workaround, use {} for initializationOptions.

This should be fixed in 11.0.0-alpha.2.

@valentjn valentjn added the 3-fixed Issue resolution: Issue has been fixed on the develop branch label Apr 3, 2021
@jcs090218
Copy link
Author

Thanks! It works! :)

Here is the Emacs client for LTEX LS, https://github.com/emacs-languagetool/lsp-ltex.

@jcs090218
Copy link
Author

And another Emacs client implementation using eglot, https://github.com/emacs-languagetool/eglot-ltex.

Just thought this might worth to mention since some users prefer eglot over lsp-mode.

@valentjn
Copy link
Owner

valentjn commented Apr 4, 2021

Great! I've added a list of language clients for LTEX LS to the readme.

@valentjn
Copy link
Owner

valentjn commented Apr 5, 2021

Fix released in 11.0.0. Please update as pre-releases are removed soon after the regular release.

@jcs090218
Copy link
Author

Awesome! Just updated to 11.0.0. See emacs-languagetool/lsp-ltex@61cd3b2. :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1-bug 🐛 Issue type: Bug report (something isn't working as expected) 2-confirmed Issue status: Confirmed, reproducible bug in LTeX 3-fixed Issue resolution: Issue has been fixed on the develop branch
Projects
None yet
Development

No branches or pull requests

2 participants