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

Cannot launch jdt.ls as sidecar #8874

Closed
ghost opened this issue Feb 22, 2018 · 9 comments
Closed

Cannot launch jdt.ls as sidecar #8874

ghost opened this issue Feb 22, 2018 · 9 comments
Labels
kind/bug Outline of a bug - must adhere to the bug report template. severity/P2 Has a minor but important impact to the usage or development of the system. sprint/current

Comments

@ghost
Copy link

ghost commented Feb 22, 2018

Current implementation (branch #5730_java_ls_poc) implies that an installer has to be switched on. There's no way to test jdt.ls as a sidecar.

	at org.eclipse.che.plugin.java.languageserver.JavaLanguageServerExtensionService.updateWorkspace(JavaLanguageServerExtensionService.java:657)
java.lang.IllegalStateException: org.eclipse.che.api.languageserver.exception.LanguageServerException: Unexpected error. Language server not found after initialization.
	at org.eclipse.che.plugin.java.languageserver.JavaLanguageServerExtensionService.doGetOne(JavaLanguageServerExtensionService.java:749)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at org.eclipse.che.plugin.java.languageserver.JavaLanguageServerExtensionService.lambda$getOrInitLanguageServer$2(JavaLanguageServerExtensionService.java:779)
Caused by: org.eclipse.che.api.languageserver.exception.LanguageServerException: Unexpected error. Language server not found after initialization.
	at org.eclipse.che.plugin.java.languageserver.WorkspaceSynchronizer.lambda$syncronizerWorkspaceAsync$0(WorkspaceSynchronizer.java:54)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at org.eclipse.che.plugin.java.languageserver.JavaLanguageServerExtensionService.executeCommand(JavaLanguageServerExtensionService.java:762)
	at java.lang.Thread.run(Thread.java:748)
2018-02-22 09:19:56,475[kspaceUpdater-0]  [ERROR] [LanguageServerExtensionService 664]  - org.eclipse.che.api.languageserver.exception.LanguageServerException: Unexpected error. Language server not found after initialization.
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	... 8 common frames omitted
2018-02-22 09:19:56,492[kspaceUpdater-0]  [ERROR] [.c.p.j.l.WorkspaceSynchronizer 58]   - Workspace updated. Result code: '1', message: 'org.eclipse.che.api.languageserver.exception.LanguageServerException: Unexpected error. Language server not found after initialization.'. Added projects: '[file:///projects/greeter]', removed projects: '[]'
2018-02-22 09:19:56,521[kspaceUpdater-0]  [INFO ] [l.r.LanguageServerRegistryImpl 175]  - required to launch for thread 35: []
	at org.eclipse.che.plugin.java.languageserver.JavaLanguageServerExtensionService.executeCommand(JavaLanguageServerExtensionService.java:760)
2018-02-22 09:19:56,533[kspaceUpdater-0]  [INFO ] [l.r.LanguageServerRegistryImpl 175]  - required to launch for thread 35: []
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at org.eclipse.che.plugin.java.languageserver.WorkspaceSynchronizer.lambda$syncronizerWorkspaceAsync$0(WorkspaceSynchronizer.java:54)
	at org.eclipse.che.plugin.java.languageserver.JavaLanguageServerExtensionService.executeCommand(JavaLanguageServerExtensionService.java:762)
java.lang.IllegalStateException: org.eclipse.che.api.languageserver.exception.LanguageServerException: Unexpected error. Language server not found after initialization.
2018-02-22 09:19:56,541[kspaceUpdater-0]  [ERROR] [LanguageServerExtensionService 664]  - org.eclipse.che.api.languageserver.exception.LanguageServerException: Unexpected error. Language server not found after initialization.
	at org.eclipse.che.plugin.java.languageserver.JavaLanguageServerExtensionService.getOrInitLanguageServer(JavaLanguageServerExtensionService.java:777)
	at java.lang.Thread.run(Thread.java:748)
	at org.eclipse.che.plugin.java.languageserver.JavaLanguageServerExtensionService.executeCommand(JavaLanguageServerExtensionService.java:760)
Caused by: org.eclipse.che.api.languageserver.exception.LanguageServerException: Unexpected error. Language server not found after initialization.
	at java.util.Optional.orElseThrow(Optional.java:290)
	at org.eclipse.che.plugin.java.languageserver.JavaLanguageServerExtensionService.lambda$getOrInitLanguageServer$2(JavaLanguageServerExtensionService.java:779)
	... 8 common frames omitted
	at org.eclipse.che.plugin.java.languageserver.JavaLanguageServerExtensionService.getOrInitLanguageServer(JavaLanguageServerExtensionService.java:777)
	at org.eclipse.che.plugin.java.languageserver.JavaLanguageServerExtensionService.doGetOne(JavaLanguageServerExtensionService.java:749)
	at org.eclipse.che.plugin.java.languageserver.JavaLanguageServerExtensionService.executeCommand(JavaLanguageServerExtensionService.java:762)
	at org.eclipse.che.plugin.java.languageserver.JavaLanguageServerExtensionService.updateWorkspace(JavaLanguageServerExtensionService.java:657)
2018-02-22 09:19:56,577[kspaceUpdater-0]  [ERROR] [LanguageServerExtensionService 664]  - org.eclipse.che.api.languageserver.exception.LanguageServerException: Unexpected error. Language server not found after initialization.
2018-02-22 09:19:56,576[kspaceUpdater-0]  [INFO ] [l.r.LanguageServerRegistryImpl 175]  - required to launch for thread 35: []
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
java.lang.IllegalStateException: org.eclipse.che.api.languageserver.exception.LanguageServerException: Unexpected error. Language server not found after initialization.
	at org.eclipse.che.plugin.java.languageserver.JavaLanguageServerExtensionService.updateWorkspace(JavaLanguageServerExtensionService.java:657)
	at org.eclipse.che.plugin.java.languageserver.JavaLanguageServerExtensionService.doGetOne(JavaLanguageServerExtensionService.java:749)
2018-02-22 09:19:56,556[kspaceUpdater-0]  [INFO ] [l.r.LanguageServerRegistryImpl 175]  - required to launch for thread 35: []
	at org.eclipse.che.plugin.java.languageserver.JavaLanguageServerExtensionService.getOrInitLanguageServer(JavaLanguageServerExtensionService.java:777)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at org.eclipse.che.plugin.java.languageserver.WorkspaceSynchronizer.lambda$syncronizerWorkspaceAsync$0(WorkspaceSynchronizer.java:54)
Caused by: org.eclipse.che.api.languageserver.exception.LanguageServerException: Unexpected error. Language server not found after initialization.
2018-02-22 09:19:56,586[kspaceUpdater-0]  [INFO ] [l.r.LanguageServerRegistryImpl 175]  - required to launch for thread 35: []
2018-02-22 09:19:56,577[kspaceUpdater-0]  [ERROR] [.c.p.j.l.WorkspaceSynchronizer 58]   - Workspace updated. Result code: '1', message: 'org.eclipse.che.api.languageserver.exception.LanguageServerException: Unexpected error. Language server not found after initialization.'. Added projects: '[file:///projects/spring]', removed projects: '[]'
	at java.util.Optional.orElseThrow(Optional.java:290)
	at org.eclipse.che.plugin.java.languageserver.JavaLanguageServerExtensionService.lambda$getOrInitLanguageServer$2(JavaLanguageServerExtensionService.java:779)
	... 8 common frames omitted
	at org.eclipse.che.plugin.java.languageserver.JavaLanguageServerExtensionService.executeCommand(JavaLanguageServerExtensionService.java:760)
	at java.util.Optional.orElseThrow(Optional.java:290)
2018-02-22 09:19:56,543[kspaceUpdater-0]  [ERROR] [.c.p.j.l.WorkspaceSynchronizer 58]   - Workspace updated. Result code: '1', message: 'org.eclipse.che.api.languageserver.exception.LanguageServerException: Unexpected error. Language server not found after initialization.'. Added projects: '[file:///projects/spring]', removed projects: '[]'
	at java.lang.Thread.run(Thread.java:748)
@ghost ghost added kind/bug Outline of a bug - must adhere to the bug report template. team/languages severity/P1 Has a major impact to usage or development of the system. labels Feb 22, 2018
@tsmaeder
Copy link
Contributor

Why is this a p1 bug?

@ghost ghost added severity/P2 Has a minor but important impact to the usage or development of the system. and removed severity/P1 Has a major impact to usage or development of the system. labels Feb 22, 2018
@ghost
Copy link
Author

ghost commented Feb 22, 2018

I meant P2, sorry.

But definitely a bug.

@tsmaeder
Copy link
Contributor

Could you expand a bit what you were trying to do to get the above stack trace? I'm aware that we don't have a sidecar jdt.ls yet, but I don't have the context otherwise.

@ghost
Copy link
Author

ghost commented Feb 22, 2018

I created a workspace without jdt.ls installer and this produced the above error.

What am I trying to achieve? Run jdt.ls as a sidecar in a Che workspace. I have an image with jdt.ls and I hoped the client would connect to it since I provided a server with attributes.

@tsmaeder tsmaeder mentioned this issue Feb 27, 2018
22 tasks
@tsmaeder tsmaeder mentioned this issue Mar 23, 2018
16 tasks
@tsmaeder
Copy link
Contributor

There is documentation on how to add a LS as a sidecar here: https://www.eclipse.org/che/docs/6/che/docs/language-servers.html#ls-sidecars
I think there are two parts to this task:

  1. Build and publish a docker image of che-ls-jdt as part of the build process
  2. Update the java launcher to connect to the sidecar instead of launching jdt.ls itself
    It would be nice to have some way to set the memory limits on jdt.ls per workspace.

@ghost
Copy link
Author

ghost commented Mar 26, 2018

@tsmaeder It is me who wrote those docs.

  1. I have an image. That's not a problem.

  2. I have unbound Java launcher and rebuilt Che assembly. That did not help. Ws-agent is looking for jdl.ls even before I open any Java file, ie when a Launcher comes into play.

@JPinkney
Copy link
Contributor

JPinkney commented Apr 5, 2018

@eivantsov When you get a chance can you post the image you were testing with somewhere so I can try to get this working

@ghost
Copy link
Author

ghost commented Apr 6, 2018

@JPinkney it's eivantsov/jdtls

language server starts in CMD via socat there. I can connect to this LS using a local client, when the language server runs in a Docker container.

@tsmaeder tsmaeder mentioned this issue Apr 13, 2018
21 tasks
@tsmaeder
Copy link
Contributor

tsmaeder commented Apr 17, 2018

There are a couple of things to heed here:

  1. We have extra wrapping code around the LanguageServer instance we create for jdt.ls. So we can't do the "instantiation by configuration". The idea instead is to refactor SocketLanguageServerLauncher so that JavaLanguageServerLauncher can derive from it. Server url will be read from machine configuration.
  2. ~/.m2 and ~/che/ls-java/data need are used to store state between runs and need to be added as volumes in workpace configs where we use jdt.ls
  3. We need a way to consume builds of che-ls-jdt for inclusion in the jdt.ls image we run. Locally, we should be able to mvn build the latest and use to rebuild the sidecar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Outline of a bug - must adhere to the bug report template. severity/P2 Has a minor but important impact to the usage or development of the system. sprint/current
Projects
None yet
Development

No branches or pull requests

3 participants