lsp4j icon indicating copy to clipboard operation
lsp4j copied to clipboard

java.lang.annotation.AnnotationTypeMismatchException

Open Huxpro opened this issue 6 years ago • 2 comments

Are there any way to debug this? I assume I annotated something wrong by not extending LanguageServer after #321 The stack trace is not quite helpful.

[info] Running test.languageserver.Main 
Starting server
[error] (run-main-11) java.lang.annotation.AnnotationTypeMismatchException: Incorrectly typed data found for annotation element public abstract boolean org.eclipse.lsp4j.jsonrpc.services.JsonRequest.useSegment() (Found data of type class java.lang.Integer[0])
[error] java.lang.annotation.AnnotationTypeMismatchException: Incorrectly typed data found for annotation element public abstract boolean org.eclipse.lsp4j.jsonrpc.services.JsonRequest.useSegment() (Found data of type class java.lang.Integer[0])
[error] 	at sun.reflect.annotation.AnnotationTypeMismatchExceptionProxy.generateException(AnnotationTypeMismatchExceptionProxy.java:57)
[error] 	at sun.reflect.annotation.AnnotationInvocationHandler.invoke(AnnotationInvocationHandler.java:84)
[error] 	at com.sun.proxy.$Proxy81.useSegment(Unknown Source)
[error] 	at org.eclipse.lsp4j.jsonrpc.services.AnnotationUtil.createRequestInfo(AnnotationUtil.java:97)
[error] 	at org.eclipse.lsp4j.jsonrpc.services.AnnotationUtil.createMethodInfo(AnnotationUtil.java:80)
[error] 	at org.eclipse.lsp4j.jsonrpc.services.AnnotationUtil.findRpcMethods(AnnotationUtil.java:64)
[error] 	at org.eclipse.lsp4j.jsonrpc.services.ServiceEndpoints.getSupportedMethods(ServiceEndpoints.java:90)
[error] 	at org.eclipse.lsp4j.jsonrpc.services.ServiceEndpoints.getSupportedMethods(ServiceEndpoints.java:82)
[error] 	at org.eclipse.lsp4j.jsonrpc.Launcher$Builder.getSupportedMethods(Launcher.java:340)
[error] 	at org.eclipse.lsp4j.jsonrpc.Launcher$Builder.createJsonHandler(Launcher.java:351)
[error] 	at org.eclipse.lsp4j.jsonrpc.Launcher$Builder.create(Launcher.java:275)
[error] 	at test.languageserver.Main$.startServer(Main.scala:43)
[error] 	at test.languageserver.Main$.$anonfun$main$1(Main.scala:22)
[error] 	at scala.util.DynamicVariable.withValue(DynamicVariable.scala:62)
[error] 	at scala.Console$.withOut(Console.scala:167)
[error] 	at test.languageserver.Main$.main(Main.scala:22)
[error] 	at test.languageserver.Main.main(Main.scala)
[error] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[error] 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[error] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[error] 	at java.lang.reflect.Method.invoke(Method.java:498)

Huxpro avatar Jun 07 '19 21:06 Huxpro

same problem

dedefer avatar Jun 08 '19 21:06 dedefer

Looks like a Scala-specific issue. Could you try with specific values for all annotation parameters, e.g. @JsonRequest(value="textDocument/completion", useSegment = false)?

spoenemann avatar Jun 11 '19 09:06 spoenemann