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

Range formatting does not work when using binary #1035

Closed
datho7561 opened this issue May 17, 2021 · 1 comment · Fixed by #1036
Closed

Range formatting does not work when using binary #1035

datho7561 opened this issue May 17, 2021 · 1 comment · Fixed by #1036
Assignees
Labels
bug Something isn't working reflection
Milestone

Comments

@datho7561
Copy link
Contributor

When attemping to range format when using the binary version of the server, the following exception is thrown:

java.lang.RuntimeException: Unable to invoke no-args constructor for class org.eclipse.lsp4j.DocumentRangeFormattingParams. Registering an InstanceCreator with Gson for this type may fix this problem.
@datho7561 datho7561 added bug Something isn't working reflection labels May 17, 2021
@datho7561 datho7561 self-assigned this May 17, 2021
datho7561 added a commit to datho7561/lemminx that referenced this issue May 17, 2021
Closes eclipse-lemminx#1035

Signed-off-by: David Thompson <davthomp@redhat.com>
@rgrunber
Copy link
Contributor

Confirmed.

[Error - 4:53:34 PM] May 17, 2021 04:53:34 org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer fireError()
Message: Unable to invoke no-args constructor for class org.eclipse.lsp4j.DocumentRangeFormattingParams. 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.DocumentRangeFormattingParams. 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:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
	at com.oracle.svm.core.thread.JavaThreads.threadStartRoutine(JavaThreads.java:519)
	at com.oracle.svm.core.posix.thread.PosixJavaThreads.pthreadStartRoutine(PosixJavaThreads.java:192)
Caused by: java.lang.reflect.InvocationTargetException
	at java.lang.reflect.Method.invoke(Method.java:498)
	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.DocumentRangeFormattingParams 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)
	... 22 more

datho7561 added a commit that referenced this issue May 17, 2021
Closes #1035

Signed-off-by: David Thompson <davthomp@redhat.com>
@datho7561 datho7561 added this to the 0.16.2 milestone May 17, 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 reflection
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants