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

UnsupportedOperationException throwing in Language Server for JakartaEE and Language Server for Liberty #530

Closed
gilbysunil14 opened this issue Oct 28, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@gilbysunil14
Copy link
Contributor

lsp4jakarta and lcls output tabs included this exception:

Oct 15, 2024 2:44:21 PM org.eclipse.lsp4j.jsonrpc.RemoteEndpoint handleNotification
WARNING: Notification threw an exception: {
  "jsonrpc": "2.0",
  "method": "$/setTrace",
  "params": {
    "value": "off"
  }
}
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.notify(GenericEndpoint.java:152)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleNotification(RemoteEndpoint.java:220)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:187)
	at io.openliberty.tools.langserver.common.ParentProcessWatcher.lambda$apply$0(ParentProcessWatcher.java:154)
	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:572)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
	at java.base/java.lang.Thread.run(Thread.java:1595)
Caused by: java.lang.reflect.InvocationTargetException
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:118)
	at java.base/java.lang.reflect.Method.invoke(Method.java:586)
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:65)
	... 12 more
Caused by: java.lang.UnsupportedOperationException
	at org.eclipse.lsp4j.services.LanguageServer.setTrace(LanguageServer.java:125)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	... 14 more
@gilbysunil14
Copy link
Contributor Author

Found similar issue in eclipse-jdtls repo (eclipse-jdtls/eclipse.jdt.ls#2891) where an UnsupportedOperationException is thrown at org.eclipse.lsp4j.services.LanguageServer.setTrace. A proposed solution can be found at eclipse-jdtls/eclipse.jdt.ls#2893 to make the '$/setTrace' as empty to avoid throwing UnsupportedOperationException.

A similar change for setTrace() as was done in eclipse-lsp4j repo for getNotebookDocumentService() here: eclipse-lsp4j/lsp4j@04b0c61#diff-c253172d13cae9e4a8c919ba451df40be7096aad30d01638383c6ed0497e7f19R92

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

No branches or pull requests

2 participants