emacs-lsp / lsp-java

lsp-mode :heart: java
https://emacs-lsp.github.io/lsp-java
GNU General Public License v3.0
650 stars 90 forks source link

Boot-ls can not find class when fetching documentation #359

Open credmp opened 3 years ago

credmp commented 3 years ago

Describe the bug When fetching documentation (lsp-describe-thing-at-point) the boot-ls server throws an exception. When only using jdtls the functionality works.

To Reproduce Enable boot server using (require 'lsp-java-boot) and call lsp-describe-thing-at-point

Expected behavior Documentation is shows as with jdtls

Logs

xception in thread "Simple-Language-Server main thread" java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer
    at org.springframework.ide.vscode.commons.util.MemoizingProxy.create(MemoizingProxy.java:60)
    at org.springframework.ide.vscode.commons.boot.app.cli.LocalSpringBootAppCache.refresh(LocalSpringBootAppCache.java:49)
    at org.springframework.ide.vscode.commons.boot.app.cli.LocalSpringBootAppCache.getAllRunningJavaApps(LocalSpringBootAppCache.java:35)
    at org.springframework.ide.vscode.commons.boot.app.cli.LocalSpringBootApp.getAllRunningJavaApps(LocalSpringBootApp.java:42)
    at org.springframework.ide.vscode.commons.boot.app.cli.LocalSpringBootApp.getAllRunningSpringApps(LocalSpringBootApp.java:46)
    at org.springframework.ide.vscode.boot.java.handlers.RunningAppProvider.lambda$static$1(RunningAppProvider.java:44)
    at org.springframework.ide.vscode.boot.java.handlers.RunningAppProvider.lambda$composite$0(RunningAppProvider.java:34)
    at org.springframework.ide.vscode.boot.java.handlers.BootJavaHoverProvider.getRunningSpringApps(BootJavaHoverProvider.java:358)
    at org.springframework.ide.vscode.boot.java.handlers.BootJavaHoverProvider.provideHoverForAnnotation(BootJavaHoverProvider.java:285)
    at org.springframework.ide.vscode.boot.java.handlers.BootJavaHoverProvider.provideHover(BootJavaHoverProvider.java:232)
    at org.springframework.ide.vscode.boot.java.handlers.BootJavaHoverProvider.lambda$provideHover$1(BootJavaHoverProvider.java:216)
    at org.springframework.ide.vscode.boot.java.utils.CompilationUnitCache.withCompilationUnit(CompilationUnitCache.java:130)
    at org.springframework.ide.vscode.boot.java.handlers.BootJavaHoverProvider.provideHover(BootJavaHoverProvider.java:213)
    at org.springframework.ide.vscode.boot.java.handlers.BootJavaHoverProvider.handle(BootJavaHoverProvider.java:87)
    at org.springframework.ide.vscode.commons.languageserver.composable.CompositeLanguageServerComponents$3.handle(CompositeLanguageServerComponents.java:109)
    at org.springframework.ide.vscode.commons.languageserver.util.SimpleTextDocumentService.lambda$hover$5(SimpleTextDocumentService.java:319)
    at reactor.core.publisher.MonoCallable.call(MonoCallable.java:91)
    at reactor.core.publisher.FluxSubscribeOnCallable$CallableSubscribeOnSubscription.run(FluxSubscribeOnCallable.java:225)
    at reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:50)
    at reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:27)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
    at java.base/java.lang.Thread.run(Thread.java:833)
Exception in thread "Simple-Language-Server main thread" java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer
    at org.springframework.ide.vscode.commons.util.MemoizingProxy.create(MemoizingProxy.java:60)
    at org.springframework.ide.vscode.commons.boot.app.cli.LocalSpringBootAppCache.refresh(LocalSpringBootAppCache.java:49)
    at org.springframework.ide.vscode.commons.boot.app.cli.LocalSpringBootAppCache.getAllRunningJavaApps(LocalSpringBootAppCache.java:35)
    at org.springframework.ide.vscode.commons.boot.app.cli.LocalSpringBootApp.getAllRunningJavaApps(LocalSpringBootApp.java:42)
    at org.springframework.ide.vscode.commons.boot.app.cli.LocalSpringBootApp.getAllRunningSpringApps(LocalSpringBootApp.java:46)
    at org.springframework.ide.vscode.boot.java.handlers.RunningAppProvider.lambda$static$1(RunningAppProvider.java:44)
    at org.springframework.ide.vscode.boot.java.handlers.RunningAppProvider.lambda$composite$0(RunningAppProvider.java:34)
    at org.springframework.ide.vscode.boot.java.handlers.BootJavaHoverProvider.getRunningSpringApps(BootJavaHoverProvider.java:358)
    at org.springframework.ide.vscode.boot.java.handlers.BootJavaHoverProvider.provideHoverForAnnotation(BootJavaHoverProvider.java:285)
    at org.springframework.ide.vscode.boot.java.handlers.BootJavaHoverProvider.provideHover(BootJavaHoverProvider.java:232)
    at org.springframework.ide.vscode.boot.java.handlers.BootJavaHoverProvider.lambda$provideHover$1(BootJavaHoverProvider.java:216)
    at org.springframework.ide.vscode.boot.java.utils.CompilationUnitCache.withCompilationUnit(CompilationUnitCache.java:130)
    at org.springframework.ide.vscode.boot.java.handlers.BootJavaHoverProvider.provideHover(BootJavaHoverProvider.java:213)
    at org.springframework.ide.vscode.boot.java.handlers.BootJavaHoverProvider.handle(BootJavaHoverProvider.java:87)
    at org.springframework.ide.vscode.commons.languageserver.composable.CompositeLanguageServerComponents$3.handle(CompositeLanguageServerComponents.java:109)
    at org.springframework.ide.vscode.commons.languageserver.util.SimpleTextDocumentService.lambda$hover$5(SimpleTextDocumentService.java:319)
    at reactor.core.publisher.MonoCallable.call(MonoCallable.java:91)
    at reactor.core.publisher.FluxSubscribeOnCallable$CallableSubscribeOnSubscription.run(FluxSubscribeOnCallable.java:225)
    at reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:50)
    at reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:27)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
    at java.base/java.lang.Thread.run(Thread.java:833)
yyoncho commented 3 years ago

Spring boot integration is lagging behind. We have to update the server(it is like 2 years old) and retest if everything works fine.

credmp commented 3 years ago

Yes, I was looking at that. The vscode extension has the unpacked language server in it, it can not be repackaged because the other jars are compressed (and nested compression is not allowed). I am looking at starting the language server from the unpacked extension.

Do you think a new (running) version would be a drop in replacement?

yyoncho commented 3 years ago

Do you think a new (running) version would be a drop in replacement?

I would say that it is 50/50. It has been a long time since the last integration and also the whole flow between jdtls -> bootls is very complex. They have several new features, we have to expose them as well. They don't have docs, so I we have to reverse engineer the code.