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 in show reference request when using binary #513

Closed
koefoed-jessen opened this issue Jun 17, 2021 · 3 comments · Fixed by eclipse/lemminx#1059
Closed

Error in show reference request when using binary #513

koefoed-jessen opened this issue Jun 17, 2021 · 3 comments · Fixed by eclipse/lemminx#1059
Assignees
Labels
binary bug Something isn't working
Milestone

Comments

@koefoed-jessen
Copy link

Using XML 0.16.1
After enabling the "prefer binary"-setting show-reference requests now hang and never return.
After enabling logging to the XML output, I get this error stacktrace:

[Error - 08.45.27] Jun 17, 2021 08:45:27 org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer fireError()
Message: Unable to invoke no-args constructor for class org.eclipse.lsp4j.ReferenceParams. Registering an InstanceCreator with Gson for this type may fix this problem.
java.lang.RuntimeException: Unable to invoke no-args constructor for class org.eclipse.lsp4j.ReferenceParams. Registering an InstanceCreator with Gson for this type may fix this problem.
at com.google.gson.internal.ConstructorConstructor$14.construct(ConstructorConstructor.java:226)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:210)
at com.google.gson.Gson.fromJson(Gson.java:888)
at org.eclipse.lsp4j.jsonrpc.json.adapters.MessageTypeAdapter.fromJson(MessageTypeAdapter.java:329)
at org.eclipse.lsp4j.jsonrpc.json.adapters.MessageTypeAdapter.parseParams(MessageTypeAdapter.java:249)
at org.eclipse.lsp4j.jsonrpc.json.adapters.MessageTypeAdapter.read(MessageTypeAdapter.java:119)
at org.eclipse.lsp4j.jsonrpc.json.adapters.MessageTypeAdapter.read(MessageTypeAdapter.java:55)
at com.google.gson.Gson.fromJson(Gson.java:888)
at org.eclipse.lsp4j.jsonrpc.json.MessageJsonHandler.parseMessage(MessageJsonHandler.java:119)
at org.eclipse.lsp4j.jsonrpc.json.MessageJsonHandler.parseMessage(MessageJsonHandler.java:114)
at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:193)
at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:94)
at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:113)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.lang.Thread.run(Thread.java:834)
at com.oracle.svm.core.thread.JavaThreads.threadStartRoutine(JavaThreads.java:519)
at com.oracle.svm.core.windows.WindowsJavaThreads.osThreadStartRoutine(WindowsJavaThreads.java:138)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Method.java:566)
at com.google.gson.internal.UnsafeAllocator$1.newInstance(UnsafeAllocator.java:50)
at com.google.gson.internal.ConstructorConstructor$14.construct(ConstructorConstructor.java:223)
... 19 more
Caused by: java.lang.IllegalArgumentException: Class org.eclipse.lsp4j.ReferenceParams is instantiated reflectively but was never registered. Register the class by using org.graalvm.nativeimage.hosted.RuntimeReflection
at com.oracle.svm.core.graal.snippets.SubstrateAllocationSnippets.hubErrorStub(SubstrateAllocationSnippets.java:246)
at sun.misc.Unsafe.allocateInstance(Unsafe.java:840)
... 22 more

Some background:
We use a separate language server that provides intellisense and navigation for an inhouse XML DSL, where show-references can be used on attribute values, which is why we are experiencing this problem.
The problem does also happen with only this XML language server enabled.
"perfer-binary"-setting was enabled as a workaround suggested in the other issue regarding out-of-memory issues, which we are also experiencing (#489)
The error does not happen when "perfer-binary" is disabled.

@fbricon fbricon added binary bug Something isn't working labels Jun 17, 2021
@angelozerr
Copy link
Contributor

angelozerr commented Jun 17, 2021

I think this issue should be fixed in 1.7.0 (we will release soon). Could you try to install the last vsix from https://download.jboss.org/jbosstools/vscode-xml/staging/?C=M;O=D

We use a separate language server that provides intellisense and navigation for an inhouse XML DSL, where show-references can be used on attribute values, which is why we are experiencing this problem.

You mean that you have implemented a LemMinX extension? if it that you cannot use binary mode which is not extensible.

@koefoed-jessen
Copy link
Author

Thank you for the response.
I have uninstalled the extension and installed vscode-xml-0.17.0-321.vsix instead, but I get the same error when attempting to show references in an xml file.

Howver, XML Support output still reports server version 0.16 - don't know if that is expected:
Message: Initializing XML Language server
LemMinX Server info:

  • Version : 0.16.3-SNAPSHOT
  • Native Image
  • VM Version : 11.0.9
  • Git 9b67968 - Generate one Codelens to associate a grammar/schema

You mean that you have implemented a LemMinX extension? if it that you cannot use binary mode which is not extensible.

It's not a LemMinX extensions, it's a separate vscode language server extension developed inhouse.

@datho7561
Copy link
Contributor

0.16.3-SNAPSHOT is the right version of the server. (We should update that though, since the next release will be a feature release). I had been testing go to references using the CodeLens, which works, and missed that the Go To References context menu doesn't work. I'll work on a fix for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
binary bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants