Open ghost opened 8 months ago
I fixed the "Failed to load extension bundles" error by filtering out the com.microsoft.java.test.runner-jar-with-dependencies.jar
from the bundles list.
This is correct based on https://github.com/eclipse-jdtls/eclipse.jdt.ls/issues/2761#issuecomment-1638311201, but apparently a harmless error according to https://github.com/mfussenegger/nvim-jdtls/issues/31#issuecomment-766432876.
In my Neovim lua config, I have the following:
local function join_path(...)
local segments = { ... }
-- TODO: Get different path separator by OS.
local sep = '\\'
local path = ''
for i, segment in ipairs(segments) do
if i == 1 then -- first index starts at 1
path = segment
else
path = path .. sep .. segment
end
end
return path
end
local mason_packages_path = join_path(vim.fn.stdpath('data'), 'mason', 'packages')
local vscode_java_test_paths = vim.fn.glob(join_path(mason_packages_path,
'java-test', 'extension', 'server', '*.jar'), true)
vscode_java_test_paths = vim.split(vscode_java_test_paths, '\n')
vscode_java_test_paths = vim.tbl_filter(function(path)
return not vim.endswith(path, 'com.microsoft.java.test.runner-jar-with-dependencies.jar')
end, vscode_java_test_paths)
This fixes that error, but I'm still unable to run unit-tests with nvim-jdtls
& nvim-dap
and see:
Tests finished. Results printed to dap-repl. All 0 succeeded
I'm also on Java 17, and using the latest vscode-java-test and java-debug bundles from Mason.
I see similar information in my LSP log file:
[ERROR][2024-03-21 16:06:21] .../vim/lsp/rpc.lua:734 "rpc" "C:\\Program Files\\Java\\jdk-17.0.4.1\\bin\\java" "stderr" "??? 21, 2024 4:06:21 ?.?. org.eclipse.lsp4j.jsonrpc.RemoteEndpoint handleCancellation\r\nWARNING: Unmatched cancel notification for request id 20\r\n"
[ERROR][2024-03-21 16:06:24] .../vim/lsp/rpc.lua:734 "rpc" "C:\\Program Files\\Java\\jdk-17.0.4.1\\bin\\java" "stderr" "??? 21, 2024 4:06:24 ?.?. com.microsoft.java.debug.core.UsageDataSession recordInfo\r\nINFO: launch debug info\r\n"
[ERROR][2024-03-21 16:06:24] .../vim/lsp/rpc.lua:734 "rpc" "C:\\Program Files\\Java\\jdk-17.0.4.1\\bin\\java" "stderr" "??? 21, 2024 4:06:24 ?.?. com.microsoft.java.debug.core.adapter.handler.LaunchRequestHandler launch\r\nINFO: Trying to launch Java Program with options:\nmain-class: org.eclipse.jdt.internal.junit.runner.RemoteTestRunner\nargs: -version 3 -port 55370 -testLoaderClass org.eclipse.jdt.internal.junit5.runner.JUnit5TestLoader -loaderpluginname org.eclipse.jdt.junit5.runtime -test <omitted>
[ERROR][2024-03-21 16:06:25] .../vim/lsp/rpc.lua:734 "rpc" "C:\\Program Files\\Java\\jdk-17.0.4.1\\bin\\java" "stderr" "??? 21, 2024 4:06:25 ?.?. org.eclipse.lsp4j.jsonrpc.RemoteEndpoint handleCancellation\r\nWARNING: Unmatched cancel notification for request id 21\r\n"
[ERROR][2024-03-21 16:06:25] .../vim/lsp/rpc.lua:734 "rpc" "C:\\Program Files\\Java\\jdk-17.0.4.1\\bin\\java" "stderr" "??? 21, 2024 4:06:25 ?.?. com.microsoft.java.debug.core.adapter.handler.LaunchWithDebuggingDelegate lambda$launchInTerminal$0\r\nINFO: Launching debuggee in terminal console succeeded.\r\n"
[ERROR][2024-03-21 16:06:28] .../vim/lsp/rpc.lua:734 "rpc" "C:\\Program Files\\Java\\jdk-17.0.4.1\\bin\\java" "stderr" "??? 21, 2024 4:06:28 ?.?. com.microsoft.java.debug.core.UsageDataSession submitUsageData\r\nINFO: session usage data summary\r\n"
[ERROR][2024-03-21 16:06:28] .../vim/lsp/rpc.lua:734 "rpc" "C:\\Program Files\\Java\\jdk-17.0.4.1\\bin\\java" "stderr" "??? 21, 2024 4:06:28 ?.?. com.microsoft.java.debug.plugin.internal.JavaDebugServer$2 run\r\nINFO: Debug connection closed\r\n"
[ERROR][2024-03-21 16:06:28] .../vim/lsp/rpc.lua:734 "rpc" "C:\\Program Files\\Java\\jdk-17.0.4.1\\bin\\java" "stderr" "??? 21, 2024 4:06:28 ?.?. org.eclipse.lsp4j.jsonrpc.RemoteEndpoint handleCancellation\r\nWARNING: Unmatched cancel notification for request id 30\r\n"
[ERROR][2024-03-21 16:06:30] .../vim/lsp/rpc.lua:734 "rpc" "C:\\Program Files\\Java\\jdk-17.0.4.1\\bin\\java" "stderr" "??? 21, 2024 4:06:30 ?.?. org.eclipse.lsp4j.jsonrpc.RemoteEndpoint handleCancellation\r\nWARNING: Unmatched cancel notification for request id 32\r\n"
[ERROR][2024-03-21 16:06:31] .../vim/lsp/rpc.lua:734 "rpc" "C:\\Program Files\\Java\\jdk-17.0.4.1\\bin\\java" "stderr" "??? 21, 2024 4:06:31 ?.?. org.eclipse.lsp4j.jsonrpc.RemoteEndpoint handleCancellation\r\nWARNING: Unmatched cancel notification for request id 33\r\n"
[ERROR][2024-03-21 16:09:36] .../vim/lsp/rpc.lua:734 "rpc" "C:\\Program Files\\Java\\jdk-17.0.4.1\\bin\\java" "stderr" "??? 21, 2024 4:09:36 ?.?. org.eclipse.lsp4j.jsonrpc.RemoteEndpoint handleCancellation\r\nWARNING: Unmatched cancel notification for request id 35\r\n"
[START][2024-03-21 16:09:40] LSP logging initiated
[ERROR][2024-03-21 16:09:40] .../vim/lsp/rpc.lua:734 "rpc" "C:\\Program Files\\Java\\jdk-17.0.4.1\\bin\\java" "stderr" "WARNING: Using incubator modules: jdk.incubator.foreign, jdk.incubator.vector\r\n"
[ERROR][2024-03-21 16:09:41] .../vim/lsp/rpc.lua:734 "rpc" "C:\\Program Files\\Java\\jdk-17.0.4.1\\bin\\java" "stderr" "??? 21, 2024 4:09:41 ?.?. org.apache.aries.spifly.BaseActivator log\r\nINFO: Registered provider ch.qos.logback.classic.servlet.LogbackServletContainerInitializer of service jakarta.servlet.ServletContainerInitializer in bundle ch.qos.logback.classic\r\n"
[ERROR][2024-03-21 16:09:41] .../vim/lsp/rpc.lua:734 "rpc" "C:\\Program Files\\Java\\jdk-17.0.4.1\\bin\\java" "stderr" "??? 21, 2024 4:09:41 ?.?. org.apache.aries.spifly.BaseActivator log\r\nINFO: Registered provider ch.qos.logback.classic.spi.LogbackServiceProvider of service org.slf4j.spi.SLF4JServiceProvider in bundle ch.qos.logback.classic\r\n"
[WARN][2024-03-21 16:09:48] ...lsp/handlers.lua:137 "The language server jdtls triggers a registerCapability handler despite dynamicRegistration set to false. Report upstream, this warning is harmless"
[ERROR][2024-03-21 16:09:48] ...lsp/handlers.lua:535 "21 Μαρ 2024, 4:09:48 μ.μ. Command _java.reloadBundles.command not supported on client"
[ERROR][2024-03-21 16:10:03] .../vim/lsp/rpc.lua:734 "rpc" "C:\\Program Files\\Java\\jdk-17.0.4.1\\bin\\java" "stderr" "??? 21, 2024 4:10:03 ?.?. org.eclipse.lsp4j.jsonrpc.RemoteEndpoint handleCancellation\r\nWARNING: Unmatched cancel notification for request id 4\r\n"
[ERROR][2024-03-21 16:10:03] .../vim/lsp/rpc.lua:734 "rpc" "C:\\Program Files\\Java\\jdk-17.0.4.1\\bin\\java" "stderr" "??? 21, 2024 4:10:03 ?.?. org.eclipse.lsp4j.jsonrpc.RemoteEndpoint handleCancellation\r\nWARNING: Unmatched cancel notification for request id 5\r\n"
[ERROR][2024-03-21 16:10:05] .../vim/lsp/rpc.lua:734 "rpc" "C:\\Program Files\\Java\\jdk-17.0.4.1\\bin\\java" "stderr" "??? 21, 2024 4:10:05 ?.?. org.eclipse.lsp4j.jsonrpc.RemoteEndpoint handleCancellation\r\nWARNING: Unmatched cancel notification for request id 6\r\n"
[ERROR][2024-03-21 16:06:21] .../vim/lsp/rpc.lua:734 "rpc" "C:\\Program Files\\Java\\jdk-17.0.4.1\\bin\\java" "stderr" "??? 21, 2024 4:06:21 ?.?. org.eclipse.lsp4j.jsonrpc.RemoteEndpoint handleCancellation\r\nWARNING: Unmatched cancel notification for request id 20\r\n"
[ERROR][2024-03-21 16:06:24] .../vim/lsp/rpc.lua:734 "rpc" "C:\\Program Files\\Java\\jdk-17.0.4.1\\bin\\java" "stderr" "??? 21, 2024 4:06:24 ?.?. com.microsoft.java.debug.core.UsageDataSession recordInfo\r\nINFO: launch debug info\r\n"
[ERROR][2024-03-21 16:06:24] .../vim/lsp/rpc.lua:734 "rpc" "C:\\Program Files\\Java\\jdk-17.0.4.1\\bin\\java" "stderr" "??? 21, 2024 4:06:24 ?.?. com.microsoft.java.debug.core.adapter.handler.LaunchRequestHandler launch\r\nINFO: Trying to launch Java Program with options:\nmain-class: org.eclipse.jdt.internal.junit.runner.RemoteTestRunner\nargs: -version 3 -port 55370 -testLoaderClass org.eclipse.jdt.internal.junit5.runner.JUnit5TestLoader -loaderpluginname org.eclipse.jdt.junit5.runtime -test com.charter.gateway.provider.location.rest.domaindata.LocationDataAccessorTest:retrieveReturnsDomainDataCollectionWithDataForAllCategories\nmodule-path: \nclass-path: <class path omitted>
[ERROR][2024-03-21 16:06:25] .../vim/lsp/rpc.lua:734 "rpc" "C:\\Program Files\\Java\\jdk-17.0.4.1\\bin\\java" "stderr" "??? 21, 2024 4:06:25 ?.?. org.eclipse.lsp4j.jsonrpc.RemoteEndpoint handleCancellation\r\nWARNING: Unmatched cancel notification for request id 21\r\n"
[ERROR][2024-03-21 16:06:25] .../vim/lsp/rpc.lua:734 "rpc" "C:\\Program Files\\Java\\jdk-17.0.4.1\\bin\\java" "stderr" "??? 21, 2024 4:06:25 ?.?. com.microsoft.java.debug.core.adapter.handler.LaunchWithDebuggingDelegate lambda$launchInTerminal$0\r\nINFO: Launching debuggee in terminal console succeeded.\r\n"
[ERROR][2024-03-21 16:06:28] .../vim/lsp/rpc.lua:734 "rpc" "C:\\Program Files\\Java\\jdk-17.0.4.1\\bin\\java" "stderr" "??? 21, 2024 4:06:28 ?.?. com.microsoft.java.debug.core.UsageDataSession submitUsageData\r\nINFO: session usage data summary\r\n"
[ERROR][2024-03-21 16:06:28] .../vim/lsp/rpc.lua:734 "rpc" "C:\\Program Files\\Java\\jdk-17.0.4.1\\bin\\java" "stderr" "??? 21, 2024 4:06:28 ?.?. com.microsoft.java.debug.plugin.internal.JavaDebugServer$2 run\r\nINFO: Debug connection closed\r\n"
[ERROR][2024-03-21 16:06:28] .../vim/lsp/rpc.lua:734 "rpc" "C:\\Program Files\\Java\\jdk-17.0.4.1\\bin\\java" "stderr" "??? 21, 2024 4:06:28 ?.?. org.eclipse.lsp4j.jsonrpc.RemoteEndpoint handleCancellation\r\nWARNING: Unmatched cancel notification for request id 30\r\n"
[ERROR][2024-03-21 16:06:30] .../vim/lsp/rpc.lua:734 "rpc" "C:\\Program Files\\Java\\jdk-17.0.4.1\\bin\\java" "stderr" "??? 21, 2024 4:06:30 ?.?. org.eclipse.lsp4j.jsonrpc.RemoteEndpoint handleCancellation\r\nWARNING: Unmatched cancel notification for request id 32\r\n"
[ERROR][2024-03-21 16:06:31] .../vim/lsp/rpc.lua:734 "rpc" "C:\\Program Files\\Java\\jdk-17.0.4.1\\bin\\java" "stderr" "??? 21, 2024 4:06:31 ?.?. org.eclipse.lsp4j.jsonrpc.RemoteEndpoint handleCancellation\r\nWARNING: Unmatched cancel notification for request id 33\r\n"
I fixed the "Failed to load extension bundles" error by filtering out the
com.microsoft.java.test.runner-jar-with-dependencies.jar
from the bundles list.
Yes! I just deleted that jar and the error went away
This fixes that error, but I'm still unable to run unit-tests with
nvim-jdtls
&nvim-dap
and see:
For me the DAP does not even attach to the buffer... But that might be my fault... I will have to look into it more
I'm also on Java 17, and using the latest vscode-java-test and java-debug bundles from Mason.
Have tried on java 21, 20 and 17 with same results
I fixed the "Failed to load extension bundles" error by filtering out the
com.microsoft.java.test.runner-jar-with-dependencies.jar
from the bundles list.Yes! I just deleted that jar and the error went away
This fixes that error, but I'm still unable to run unit-tests with
nvim-jdtls
&nvim-dap
and see:For me the DAP does not even attach to the buffer... But that might be my fault... I will have to look into it more
I'm also on Java 17, and using the latest vscode-java-test and java-debug bundles from Mason.
Have tried on java 21, 20 and 17 with same results
My plan is to revert back to older versions of JDTLS, the bundles, and various Neovim plugins.
I'll try and follow-up here again if I can find a working set of older versions.
I fixed the "Failed to load extension bundles" error by filtering out the
com.microsoft.java.test.runner-jar-with-dependencies.jar
from the bundles list.Yes! I just deleted that jar and the error went away
This fixes that error, but I'm still unable to run unit-tests with
nvim-jdtls
&nvim-dap
and see:For me the DAP does not even attach to the buffer... But that might be my fault... I will have to look into it more
I'm also on Java 17, and using the latest vscode-java-test and java-debug bundles from Mason.
Have tried on java 21, 20 and 17 with same results
My plan is to revert back to older versions of JDTLS, the bundles, and various Neovim plugins.
I'll try and follow-up here again if I can find a working set of older versions.
Wow... That would be tough... as is not my only development stack.... anywho that would be appreciated
Also, then this is not a JDTLS issue?
Wow... That would be tough... as is not my only development stack.... anywho that would be appreciated
Also, then this is not a JDTLS issue?
It's hard to say!
Maybe something from our logs will stand out to someone more familiar with JDTS.
If you had a working set of versions, and only upgraded the version of JDTLS, then you could isolate the problem to some change introduced in that new version.
Once I revert back to a working set of versions, then I'll upgrade each dependency - one at a time - to determine what makes the tests stop working.
The versions of the various dependencies could be incompatible with each other.
These include:
Wow... That would be tough... as is not my only development stack.... anywho that would be appreciated Also, then this is not a JDTLS issue?
It's hard to say!
Maybe something from our logs will stand out to someone more familiar with JDTS.
If you had a working set of versions, and only upgraded the version of JDTLS, then you could isolate the problem to some change introduced in that new version.
Once I revert back to a working set of versions, then I'll upgrade each dependency - one at a time - to determine what makes the tests stop working.
The versions of the various dependencies could be incompatible with each other.
These include:
- Java
- JDTLS
- vscode-java-test
- java-debug
- Neovim
- nvim-dap
- nvim-dap-ui (not sure if you're using this, but I am)
- nvim-jdtls
I see
I actually started using neovim very recently... so I am on the latest version (0.9?? if I am not wrong)... I also use every thing you mentioned.... I don't really have any spare time now... But I'll try to check out other version combinations when I am free.. If you find something please do send a comment on this thread.
Thanks! Cheers :)
I see
I actually started using neovim very recently... so I am on the latest version (0.9?? if I am not wrong)... I also use every thing you mentioned.... I don't really have any spare time now... But I'll try to check out other version combinations when I am free.. If you find something please do send a comment on this thread.
Thanks! Cheers :)
The following versions are a year or so old, but work for me:
vscode-java-test
0.39.0
:MasonInstall java-test@0.39.0
0.9.5
nvim-dap
debd7c2f80eaf20c5f5df25db8d8c1b9b18f4421
nvim-dap-ui
c020f660b02772f9f3d11f599fefad3268628a9e
nvim-jdtls
8eb5f0dbe6e126b392ddcaf45893358619893e45
(latest commit at the time of writing)Mason can't install older versions of JDTLS & java-debug
so you have to manually download them.
(I made an issue about this here: https://github.com/williamboman/mason.nvim/issues/1661.)
If it's helpful, you can view my configuration here: https://github.com/gbroques/neovim-configuration/tree/f6cf8c6d97c6df908f86313651757bb840dcc8d6
I see I actually started using neovim very recently... so I am on the latest version (0.9?? if I am not wrong)... I also use every thing you mentioned.... I don't really have any spare time now... But I'll try to check out other version combinations when I am free.. If you find something please do send a comment on this thread. Thanks! Cheers :)
The following versions are a year or so old, but work for me:
- Java 17.0.4.1
- JDTLS 1.24.0
vscode-java-test
0.39.0
:MasonInstall java-test@0.39.0
- java-debug 0.46.0
- Neovim
0.9.5
nvim-dap
debd7c2f80eaf20c5f5df25db8d8c1b9b18f4421
nvim-dap-ui
c020f660b02772f9f3d11f599fefad3268628a9e
nvim-jdtls
8eb5f0dbe6e126b392ddcaf45893358619893e45
(latest commit at the time of writing)Mason can't install older versions of JDTLS &
java-debug
so you have to manually download them.(I made an issue about this here: williamboman/mason.nvim#1661.)
If it's helpful, you can view my configuration here: https://github.com/gbroques/neovim-configuration/tree/f6cf8c6d97c6df908f86313651757bb840dcc8d6
I see.... I will have to try that out... Thanks for the heads up..
Cheers :)
I am trying to set up java debugging in Neovim using nvim-dap and nvim-jdtls. The LSP and autocompletion works but the bundles for DAP are causing plugins (bundles from vscode-java-test and java-debug). These bundle have been installed using mason a package manager for LSP, DAPs, etc
Have JavaSE-17.0.6 installed and setup in env vars. Closest issue similar to my problem, I found was this. Did not help Is this a problem with my configuration?
Log provided by nvim-jdtls
Also here is my jdtls setup. Just in case.