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

Could not load main pom file content, see example #2325

Closed
zhouxinghong opened this issue Feb 19, 2022 · 13 comments
Closed

Could not load main pom file content, see example #2325

zhouxinghong opened this issue Feb 19, 2022 · 13 comments

Comments

@zhouxinghong
Copy link

zhouxinghong commented Feb 19, 2022

Deprecated. . .

@snjeza
Copy link
Contributor

snjeza commented Feb 20, 2022

I can't reproduce the issue.
@zhouxinghong Could you, please, attach a sample project reproducing the error?

@Eskibear
Copy link
Contributor

Just tried, I can sometimes reproduce this issue with a simple spring boot project. On opening vscode, symbols are correctly shown, and during Java extension activation, it triggered a refresh of the Outline view, and sometimes it keeps loading forever.

But I'm wondering which extension provides this "outline" view of pom.xml. @zhouxinghong Do you also have XML extension installed?

@angelozerr
Copy link
Contributor

But I'm wondering which extension provides this "outline" view of pom.xml.

This outline is filled by vscode-xml (with LSP). The issue is for vscode-xml or LemMinX.

Badly I cannot reproduce it with spring boot sample -(

@zhouxinghong could you enable xml trace https://github.com/redhat-developer/vscode-xml/blob/master/docs/Troubleshooting.md#no-support-on-xml-file and share your trace please

@angelozerr
Copy link
Contributor

angelozerr commented Feb 21, 2022

@zhouxinghong as I explained you I cannot reproduce it with your sample project.

So please share your trace in order to I try and guess the problem.

@angelozerr
Copy link
Contributor

@snjeza
Copy link
Contributor

snjeza commented Feb 21, 2022

@angelozerr I can't reproduce the issue on Fedora 35 and Windows 10
VS Code Version: 1.65.0-insider
Commit: a0da9978b10ae0b9307c7f545b50a8500efff7eb
Date: 2022-02-21T05:15:22.150Z

project https://github.com/redhat-developer/vscode-java/files/8105487/myspringboot.zip

xmllog.txt

@angelozerr
Copy link
Contributor

angelozerr commented Feb 21, 2022

@angelozerr I can't reproduce the issue on Fedora 35 and Windows 10

@snjeza thanks for your feedback. I have the similar trace than you, in other words I cannot reproduce it.

This problem occurs in 99% of cases

it seems it's easy for you to reproduce it, so @zhouxinghong please share your trace.

@Eskibear
Copy link
Contributor

I managed to reproduce it, and sometimes another "no symbols found in document" error also occurs, as below:

xml-outline.mp4

Corresponding logs attached below, where I don't see any problem, as documentSymbols responses are correctly received.

xml.log

You can see in above video, at first the symbols are there in outline view. Once Java language server was ready, the outline was cleared. BTW, if I've installed Java Extension Pack and Spring Extension Pack. If I disable vscode-java and all its dependencies, the problem is gone. I'm thinking the culprit might be some conflicts between one of the Java extensions and the XML extension? Who else also contributes to outline view for .xml files?

@Eskibear
Copy link
Contributor

cc @jdneo @CsCherrYY see if Project Manager for Java has any relationship with it.

@Eskibear
Copy link
Contributor

I tried re-enabling those extensions one by one (Java Extension, Project Manager, Spring Boot Tools), and after Spring Boot Tools extension is enabled, the problem is back. And I find if you are patient enough to wait longer time, like 1 min, the symbols would eventually show in outline view.

AFAIK, Spring Boot Tools also provides outline information. I'm wondering if it's because both extension has outline provider, but for pom.xml Spring extension's request is stuck on somewhere, and vscode only render the view after Spring extension's request is timeout.

I'll invite @BoykoAlex to take a look.

@angelozerr
Copy link
Contributor

@Eskibear thanks so much for your feedback. After installing Spring Boot Tools, I can reproduce the problem easily. As you said, the XML support provides the proper symbols.

I have the impression that Spring Boot Tools contribute to the LSP Outline with symbols. Here my Spring trace:

07:05:00.172 [main] INFO  o.s.i.v.b.a.BootLanguageServerBootApp - Starting BootLanguageServerBootApp on azerr-w10e with PID 24648 (C:\Users\azerr\.vscode\extensions\pivotal.vscode-spring-boot-1.31.0\language-server\BOOT-INF\classes started by azerr in c:\Users\azerr\Downloads\myspringboot)
07:05:00.177 [main] INFO  o.s.i.v.b.a.BootLanguageServerBootApp - No active profile set, falling back to default profiles: default
07:05:02.289 [main] INFO  o.s.i.v.b.jdt.ls.JdtLsProjectCache - added listener - now listeners registered: 1
07:05:02.477 [main] INFO  o.s.i.v.b.jdt.ls.JdtLsProjectCache - added listener - now listeners registered: 2
07:05:02.654 [main] INFO  o.s.i.v.b.jdt.ls.JdtLsProjectCache - added listener - now listeners registered: 3
07:05:02.850 [main] INFO  o.s.i.v.b.jdt.ls.JdtLsProjectCache - added listener - now listeners registered: 4
07:05:02.850 [main] INFO  o.s.i.v.boot.app.SpringSymbolIndex - project listener registered
07:05:03.089 [main] INFO  o.s.i.v.b.jdt.ls.JdtLsProjectCache - added listener - now listeners registered: 5
07:05:03.262 [main] INFO  o.s.i.v.b.jdt.ls.JdtLsProjectCache - added listener - now listeners registered: 6
07:05:03.266 [main] INFO  o.s.i.v.b.j.l.v.SpringProcessCommandHandler - Registered command handler: sts/livedata/listProcesses
07:05:03.269 [main] INFO  o.s.i.v.b.j.l.v.SpringProcessCommandHandler - Registered command handler: sts/livedata/connect
07:05:03.269 [main] INFO  o.s.i.v.b.j.l.v.SpringProcessCommandHandler - Registered command handler: sts/livedata/refresh
07:05:03.270 [main] INFO  o.s.i.v.b.j.l.v.SpringProcessCommandHandler - Registered command handler: sts/livedata/disconnect
07:05:03.277 [main] INFO  o.s.i.v.b.jdt.ls.JdtLsProjectCache - added listener - now listeners registered: 7
07:05:03.315 [main] INFO  o.s.i.v.b.jdt.ls.JdtLsProjectCache - added listener - now listeners registered: 8
07:05:03.324 [main] INFO  o.s.i.v.b.jdt.ls.JdtLsProjectCache - added listener - now listeners registered: 9
07:05:03.454 [main] INFO  o.s.i.v.b.a.BootLanguageServerBootApp - Started BootLanguageServerBootApp in 4.618 seconds (JVM running for 6.11)
07:05:03.457 [main] INFO  o.s.i.v.c.l.LanguageServerRunner - java.home = c:\Users\azerr\.vscode\extensions\redhat.java-1.3.0\jre\17.0.1-win32-x86_64
07:05:03.458 [LanguageServerApp-lifecycle] INFO  o.s.i.v.c.l.LanguageServerRunner - Server ready to start after 6114 ms
07:05:03.458 [LanguageServerApp-lifecycle] INFO  o.s.i.v.c.l.LanguageServerRunner - Starting LS as client
07:05:03.458 [LanguageServerApp-lifecycle] INFO  o.s.i.v.c.l.LanguageServerRunner - Connected to parent using stdio
07:05:03.719 [pool-5-thread-1] INFO  o.s.i.v.c.l.u.SimpleLanguageServer - Initializing
07:05:03.752 [pool-5-thread-1] INFO  o.s.i.v.c.l.u.CompletionServerCapabilityRegistration - hasDynamicCompletionRegistration = true
07:05:03.754 [pool-5-thread-1] INFO  o.s.i.v.c.l.u.SimpleLanguageServer - Returning server capabilities to client
07:05:03.795 [pool-5-thread-1] INFO  o.s.i.v.boot.app.SpringSymbolIndex - update settings of spring indexer - start
07:05:03.796 [pool-5-thread-1] INFO  o.s.i.v.boot.app.SpringSymbolIndex - update settings of spring indexer - done
07:05:03.796 [pool-5-thread-1] INFO  o.s.i.v.b.j.BootJavaLanguageServerComponents - update live process tracker settings - start
07:05:03.796 [pool-5-thread-1] INFO  o.s.i.v.b.j.BootJavaLanguageServerComponents - update live process tracker settings - done
07:05:03.796 [pool-5-thread-1] INFO  o.s.i.v.b.a.BootLanguageServerInitializer - A configuration changed, triggering reconcile on all open documents
07:05:03.797 [pool-5-thread-1] INFO  o.s.i.v.b.j.l.v.SpringProcessConnectorRemote - updating settings for remote processses to track - start
07:05:03.797 [Simple-Language-Server main thread] INFO  o.s.i.v.c.l.u.CompletionServerCapabilityRegistration - Registering Dynamic Completion Capabality
07:05:03.801 [pool-5-thread-1] INFO  o.s.i.v.b.j.l.v.SpringProcessConnectorRemote - updating settings for remote processses to track - done
07:05:03.803 [pool-5-thread-1] INFO  o.s.i.v.c.l.u.SimpleTextDocumentService - change arrived: 1
07:05:03.811 [Simple-Language-Server main thread] INFO  o.s.i.v.c.l.u.SimpleLanguageServer - Initialization completed after 6467 ms
07:05:03.831 [pool-5-thread-1] INFO  o.s.i.v.b.j.u.CompilationUnitCache - CU Cache: invalidate AST for file:///c%3A/Users/azerr/Downloads/myspringboot/pom.xml
07:05:03.849 [pool-5-thread-1] INFO  o.s.i.v.b.jdt.ls.JdtLsProjectCache - Project Observer is supported
07:05:03.960 [pool-5-thread-1] INFO  o.s.i.v.b.jdt.ls.JdtLsProjectCache - addClasspathListener ...
07:05:04.027 [pool-5-thread-1] INFO  o.s.i.v.b.jdt.ls.JdtLsProjectCache - addClasspathListener DONE
07:05:04.047 [Simple-Language-Server main thread] INFO  o.s.i.v.b.jdt.ls.JdtLsProjectCache - Project Created: file:/C:/Users/azerr/AppData/Roaming/Code/User/workspaceStorage/301a3ea1f2623ad7a421d56019794dda/redhat.java/jdt_ws/jdt.ls-java-project
07:05:04.047 [Simple-Language-Server main thread] INFO  o.s.i.v.b.jdt.ls.JdtLsProjectCache - Classpath has 2 entries
07:05:04.047 [Simple-Language-Server main thread] INFO  o.s.i.v.b.jdt.ls.JdtLsProjectCache - listeners registered: 9
07:05:04.047 [Simple-Language-Server main thread] INFO  o.s.i.v.b.j.u.CompilationUnitCache - CU Cache: created project jdt.ls-java-project
07:05:04.048 [Simple-Language-Server main thread] INFO  o.s.i.v.b.j.u.CompilationUnitCache - CU Cache: invalidate project <jdt.ls-java-project>
07:05:04.924 [Simple-Language-Server main thread] INFO  o.s.i.v.boot.app.SpringSymbolIndex - project created event: jdt.ls-java-project
07:05:04.936 [Simple-Language-Server main thread] INFO  o.s.i.v.b.a.BootLanguageServerInitializer - A project changed jdt.ls-java-project, triggering reconcile on all project's open documents
07:05:05.009 [Simple-Language-Server main thread] INFO  o.s.i.v.b.jdt.ls.JdtLsProjectCache - Project Created: file:/C:/Users/azerr/Downloads/myspringboot/myspringboot-base
07:05:05.010 [Simple-Language-Server main thread] INFO  o.s.i.v.b.jdt.ls.JdtLsProjectCache - Classpath has 45 entries
07:05:05.010 [Simple-Language-Server main thread] INFO  o.s.i.v.b.jdt.ls.JdtLsProjectCache - listeners registered: 9
07:05:05.011 [Simple-Language-Server main thread] INFO  o.s.i.v.b.j.u.CompilationUnitCache - CU Cache: created project myspringboot-base
07:05:05.011 [Simple-Language-Server main thread] INFO  o.s.i.v.b.j.u.CompilationUnitCache - CU Cache: invalidate project <myspringboot-base>
07:05:05.091 [Simple-Language-Server main thread] INFO  o.s.i.v.boot.app.SpringSymbolIndex - project created event: myspringboot-base
07:05:05.096 [Simple-Language-Server main thread] INFO  o.s.i.v.b.a.BootLanguageServerInitializer - A project changed myspringboot-base, triggering reconcile on all project's open documents
07:05:05.110 [pool-2-thread-1] INFO  o.s.i.v.b.j.utils.SpringIndexerJava - scan java files for symbols for project: myspringboot-base - no. of files: 1
07:05:05.128 [pool-2-thread-1] INFO  o.s.i.v.b.j.utils.SpringIndexerJava - scan java files, AST parse, pass 1 for files: 1
07:05:06.289 [pool-2-thread-1] INFO  o.s.i.v.b.j.utils.SpringIndexerJava - scan java files done, number of symbols created: 2
07:05:06.324 [pool-2-thread-1] INFO  o.s.i.v.b.j.utils.SpringIndexerJava - scan java files for symbols for project: myspringboot-base took ms: 1214
07:05:14.562 [ForkJoinPool.commonPool-worker-2] INFO  o.s.i.v.c.l.u.SimpleTextDocumentService - hover computation done in 0ms
07:05:16.896 [pool-5-thread-1] INFO  o.s.i.v.c.l.u.SimpleTextDocumentService - Closed: file:///c%3A/Users/azerr/Downloads/myspringboot/pom.xml
07:05:16.909 [pool-5-thread-1] INFO  o.s.i.v.b.j.u.CompilationUnitCache - CU Cache: invalidate AST for file:///c%3A/Users/azerr/Downloads/myspringboot/pom.xml
07:05:17.387 [pool-5-thread-1] INFO  o.s.i.v.c.l.u.SimpleTextDocumentService - change arrived: 1
07:05:17.389 [pool-5-thread-1] INFO  o.s.i.v.b.j.u.CompilationUnitCache - CU Cache: invalidate AST for file:///c%3A/Users/azerr/Downloads/myspringboot/myspringboot-base/pom.xml
07:05:17.401 [pool-5-thread-1] WARN  o.e.lsp4j.jsonrpc.RemoteEndpoint - Unmatched cancel notification for request id 7
07:05:29.320 [pool-5-thread-1] INFO  o.s.i.v.c.l.u.SimpleTextDocumentService - change arrived: 1
07:05:29.321 [pool-5-thread-1] INFO  o.s.i.v.b.j.u.CompilationUnitCache - CU Cache: invalidate AST for file:///c%3A/Users/azerr/Downloads/myspringboot/pom.xml
07:05:37.501 [pool-5-thread-1] INFO  o.s.i.v.c.l.u.SimpleTextDocumentService - Closed: file:///c%3A/Users/azerr/Downloads/myspringboot/pom.xml
07:05:37.502 [pool-5-thread-1] INFO  o.s.i.v.b.j.u.CompilationUnitCache - CU Cache: invalidate AST for file:///c%3A/Users/azerr/Downloads/myspringboot/pom.xml
07:05:42.845 [pool-5-thread-1] INFO  o.s.i.v.c.l.u.SimpleTextDocumentService - change arrived: 1
07:05:42.845 [pool-5-thread-1] INFO  o.s.i.v.b.j.u.CompilationUnitCache - CU Cache: invalidate AST for file:///c%3A/Users/azerr/Downloads/myspringboot/pom.xml
07:06:03.989 [ForkJoinPool.commonPool-worker-1] WARN  o.s.i.v.boot.app.SpringSymbolIndex - 
java.util.concurrent.TimeoutException: null
	at java.base/java.util.concurrent.CompletableFuture.timedGet(Unknown Source)
	at java.base/java.util.concurrent.CompletableFuture.get(Unknown Source)
	at org.springframework.ide.vscode.boot.app.SpringSymbolIndex.getSymbols(SpringSymbolIndex.java:551)
	at org.springframework.ide.vscode.boot.java.handlers.BootJavaDocumentSymbolHandler.handle(BootJavaDocumentSymbolHandler.java:33)
	at org.springframework.ide.vscode.commons.languageserver.util.SimpleTextDocumentService.lambda$documentSymbol$9(SimpleTextDocumentService.java:395)
	at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(Unknown Source)
	at java.base/java.util.concurrent.CompletableFuture$Completion.exec(Unknown Source)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(Unknown Source)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(Unknown Source)
	at java.base/java.util.concurrent.ForkJoinPool.scan(Unknown Source)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source)
07:06:18.124 [pool-5-thread-1] INFO  o.s.i.v.c.l.u.SimpleTextDocumentService - Closed: file:///c%3A/Users/azerr/Downloads/myspringboot/pom.xml
07:06:18.125 [pool-5-thread-1] INFO  o.s.i.v.b.j.u.CompilationUnitCache - CU Cache: invalidate AST for file:///c%3A/Users/azerr/Downloads/myspringboot/pom.xml
07:06:29.340 [ForkJoinPool.commonPool-worker-2] WARN  o.s.i.v.boot.app.SpringSymbolIndex - 
java.util.concurrent.TimeoutException: null
	at java.base/java.util.concurrent.CompletableFuture.timedGet(Unknown Source)
	at java.base/java.util.concurrent.CompletableFuture.get(Unknown Source)
	at org.springframework.ide.vscode.boot.app.SpringSymbolIndex.getSymbols(SpringSymbolIndex.java:551)
	at org.springframework.ide.vscode.boot.java.handlers.BootJavaDocumentSymbolHandler.handle(BootJavaDocumentSymbolHandler.java:33)
	at org.springframework.ide.vscode.commons.languageserver.util.SimpleTextDocumentService.lambda$documentSymbol$9(SimpleTextDocumentService.java:395)
	at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(Unknown Source)
	at java.base/java.util.concurrent.CompletableFuture$Completion.exec(Unknown Source)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(Unknown Source)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(Unknown Source)
	at java.base/java.util.concurrent.ForkJoinPool.scan(Unknown Source)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source)
07:06:31.889 [pool-5-thread-1] INFO  o.s.i.v.c.l.u.SimpleTextDocumentService - change arrived: 1
07:06:31.889 [pool-5-thread-1] INFO  o.s.i.v.b.j.u.CompilationUnitCache - CU Cache: invalidate AST for file:///c%3A/Users/azerr/Downloads/myspringboot/pom.xml
07:06:42.855 [ForkJoinPool.commonPool-worker-4] WARN  o.s.i.v.boot.app.SpringSymbolIndex - 
java.util.concurrent.TimeoutException: null
	at java.base/java.util.concurrent.CompletableFuture.timedGet(Unknown Source)
	at java.base/java.util.concurrent.CompletableFuture.get(Unknown Source)
	at org.springframework.ide.vscode.boot.app.SpringSymbolIndex.getSymbols(SpringSymbolIndex.java:551)
	at org.springframework.ide.vscode.boot.java.handlers.BootJavaDocumentSymbolHandler.handle(BootJavaDocumentSymbolHandler.java:33)
	at org.springframework.ide.vscode.commons.languageserver.util.SimpleTextDocumentService.lambda$documentSymbol$9(SimpleTextDocumentService.java:395)
	at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(Unknown Source)
	at java.base/java.util.concurrent.CompletableFuture$Completion.exec(Unknown Source)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(Unknown Source)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(Unknown Source)
	at java.base/java.util.concurrent.ForkJoinPool.scan(Unknown Source)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source)
07:07:31.897 [ForkJoinPool.commonPool-worker-2] WARN  o.s.i.v.boot.app.SpringSymbolIndex - 
java.util.concurrent.TimeoutException: null
	at java.base/java.util.concurrent.CompletableFuture.timedGet(Unknown Source)
	at java.base/java.util.concurrent.CompletableFuture.get(Unknown Source)
	at org.springframework.ide.vscode.boot.app.SpringSymbolIndex.getSymbols(SpringSymbolIndex.java:551)
	at org.springframework.ide.vscode.boot.java.handlers.BootJavaDocumentSymbolHandler.handle(BootJavaDocumentSymbolHandler.java:33)
	at org.springframework.ide.vscode.commons.languageserver.util.SimpleTextDocumentService.lambda$documentSymbol$9(SimpleTextDocumentService.java:395)
	at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(Unknown Source)
	at java.base/java.util.concurrent.CompletableFuture$Completion.exec(Unknown Source)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(Unknown Source)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(Unknown Source)
	at java.base/java.util.concurrent.ForkJoinPool.scan(Unknown Source)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source)

I have several exception with :

java.util.concurrent.TimeoutException: null
	at java.base/java.util.concurrent.CompletableFuture.timedGet(Unknown Source)
	at java.base/java.util.concurrent.CompletableFuture.get(Unknown Source)
	at org.springframework.ide.vscode.boot.app.SpringSymbolIndex.getSymbols(SpringSymbolIndex.java:551)

I supsect it's the problem. I have the impression that Spring Boot Toos compute symbols on background and when it try to get symbols for the pom.xml file it throw an error.

But this error is for any XML file. You can create a foo.xml with any XML content and you will see the problem. As soon as you create a XML file, you can see the problem and you need to wait for around 1 minute to see the outline correctly filled.

@BoykoAlex hope my feedback will help you to discover the problem.

I don't know where to view the trace. . . can you tell me

https://github.com/redhat-developer/vscode-xml/blob/master/docs/Troubleshooting.md#no-support-on-xml-file cannot help you? If you need some other informations please tell me and I will update the doc.

@BoykoAlex
Copy link

BoykoAlex commented Feb 23, 2022

@angelozerr I have pushed 3f6e23ae5a7b06e7fb1ecdf79eff3ab2d5df8cc4 - should help with this issue

@fbricon
Copy link
Collaborator

fbricon commented Feb 23, 2022

Closing as it's a Spring Boot Tools issue, nothing else to do here.

@fbricon fbricon closed this as completed Feb 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants