Skip to content

Error in show reference request when using binary #513

@koefoed-jessen

Description

@koefoed-jessen

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.

Metadata

Metadata

Assignees

Labels

binarybugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions