sublimelsp / LSP-jdtls

Convenience package for the Eclipse JDT language server
https://packagecontrol.io/packages/LSP-jdtls
MIT License
30 stars 4 forks source link

JDTLS exited with status code 13 #21

Open ildella opened 2 years ago

ildella commented 2 years ago

After first install LSP + LSP-jdtls I got it working.

After a few days, it stop working with this error in the picture here.

I managed to get it back to work once, deleting the folder ~/.cache/sublime-text/Package Storage/LSP-jdtls but now is still not working. I can'f find any log anywhere else.

It is using java 18, but the same result I get with Java 11. Running under Ubuntu 22.04 and latest Sublime 4 build.

As additional info, I debugged the plugin and printed the return json at the end of additional_variables(cls) method

{'java_executable': '~/.sdkman/candidates/java/18.0.1-open/bin/java', 'launcher_version': '1.6.400.v20210924-0641', 'watch_parent_process': 'true', 'serverdir': '/home/ildella/.cache/sublime-text/Package Storage/LSP-jdtls/server/1.13.0-202206092056', 'datadir': '/home/ildella/.cache/sublime-text/Package Storage/LSP-jdtls/data', 'jdtls_platform': 'linux'}
ildella commented 2 years ago

I did run the Server Troubleshoot command where I found the actual shell command, then run it and the output did finally point me to a log file, here it is:

$ cat ~/.cache/sublime-text/Package\ Storage/LSP-jdtls/server/1.13.0-202206092056/config_linux/1655120899638.log 
!SESSION 2022-06-13 13:48:19.570 -----------------------------------------------
eclipse.buildId=unknown
java.version=18.0.1
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Command-line arguments:  -data /home/ildella/.cache/sublime-text/Package Storage/LSP-jdtls/data

!ENTRY org.eclipse.osgi 4 0 2022-06-13 13:48:19.750
!MESSAGE Application error
!STACK 1
java.lang.IllegalStateException: Unable to acquire application service. Ensure that the org.eclipse.core.runtime bundle is resolved and started (see config.ini).
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:81)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
    at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
    at java.base/java.lang.reflect.Method.invoke(Method.java:577)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:596)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1467)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1440)
meengit commented 2 years ago

Hi @ildella, I can confirm having the same issue since today. LSP-jdtls and directly configured jdtls in LSP Settings does not work anymore. Unfortunately, I'm under pressure in these days and can't dig into the issue before the end of the week. The LSP Troubleshooting also gives me a different error message:

Screenshot 2022-06-13 at 18 02 03

I also can't exclude misconfiguration on my side at the moment. The only thing I can say is: it worked without any issue until today. Since today, I also struggle with JDTLS exited with status code 13.

ildella commented 2 years ago

I fixed it setting the version in LSP settings to

"version": "1.12.0-202206011637",

I know for sure that a couple time did work in the past week, and that random effect was suspect. It's probably related to some build being broken or incompatible or missing or... sonething else.

Fixing the version feels a more stable solution anyway, maybe it could become the default in place of the version: '' that just fetch the latest snapshot. As a minimum I would mention this important aspect in the README.

For posterity: available versions can be found here: https://download.eclipse.org/jdtls/snapshots/

rwols commented 2 years ago

See also https://github.com/sublimelsp/LSP-jdtls/issues/12

meengit commented 2 years ago

Thank you very much for the responses @ildella and @rwols. Setting the version explicitly worked!

ildella commented 2 years ago

It seem that the problem runs much deeper and today is still not working.

Is there a way to tell LSP plugin to connect to an already running JDTLS server that I can start from terminal?

[UPDATE]

Basically every once in a while after restart, JDTLS give me the 13 error code. To fix it, I basically change the "version" in the config to download another, any would do, and it starts again.

LDAP commented 2 years ago

I believe changing the server version fixes this issue because part of the update procedure is clearing the data directory.

I don't think pinning the server version will fix this, please try #22 anyway and report back.

Can you please provide more information on your system? And how are you closing sublime? In my opinion, what you really face is a corruption of the data directory. Maybe the server cannot gracefully shut down on your system.

ildella commented 2 years ago

I've tried but with not more luck. As I stated in the UPDATE in my last message https://github.com/sublimelsp/LSP-jdtls/issues/21#issuecomment-1155057425 even when I set the version, the plugins fails to start and I have to change the version again.

It seems to me that something got stuck, and only a fresh start fixes it.

LDAP commented 2 years ago

I cannot reproduce the issue on my system.

Please provide more info on your system and a complete copy of the Throubleshoot Server command.

How are you closing sublime? (eg. if you use a command, provide the exact command)

MFAshby commented 2 years ago

jdtls.log.txt

Hi, I'm hitting the same issue. Looks like something changed in the jdtls jar?

MFAshby commented 2 years ago

yeah it looks like this: https://github.com/eclipse/eclipse.jdt.ls/issues/1520

I'm on java 11, and it seems like that isn't supported in later versions of jdtls.

MFAshby commented 2 years ago

Workaround: download a newer JDK and set "java.home" property in LSP-jdtls.settings, e.g.

{
        "settings": {
                "java.home": "/usr/lib/jvm/java-19-openjdk/"
        }
}

Suggested change in LDP-jdtls; error message if java version is too old for jdtls?

AirBashX commented 2 years ago

It seems that the new version of Eclipse only supports JDK11

Jeangowhy commented 1 year ago

What is going on when the Troubleshoot Server return “HTTP ERROR NOT FOUND”?

LDAP commented 1 year ago

What is going on when the Troubleshoot Server return “HTTP ERROR NOT FOUND”?

Please open a new issue. Include the last lines from the Sublime console and the LSP log (LSP: Toggle Log Panel command).

RafaTeya commented 1 year ago

I fixed it setting the version in LSP settings to

"version": "1.12.0-202206011637",

I know for sure that a couple time did work in the past week, and that random effect was suspect. It's probably related to some build being broken or incompatible or missing or... sonething else.

Fixing the version feels a more stable solution anyway, maybe it could become the default in place of the version: '' that just fetch the latest snapshot. As a minimum I would mention this important aspect in the README.

For posterity: available versions can be found here: https://download.eclipse.org/jdtls/snapshots/

Pinning the version worked for me.

mataha commented 5 months ago

I'd like to suggest downloading a JDK exclusively for use with jdt.ls, just like Node-based LSP clients do.