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

Opening Spring Boot project in VSCode leads to StackOverflowError #1166

Closed
vbadev opened this issue Jan 10, 2024 · 7 comments
Closed

Opening Spring Boot project in VSCode leads to StackOverflowError #1166

vbadev opened this issue Jan 10, 2024 · 7 comments
Assignees
Labels
for: eclipse something that is specific for Eclipse for: vscode something that is specific for VSCode theme: validation type: bug

Comments

@vbadev
Copy link

vbadev commented Jan 10, 2024

Describe the bug
A clear and concise description of what the bug is.
Opening Spring Boot project is opened error message is shown from VSCode - Request textDocument/codeAction failed.:

image

Extension log file from Go to output button:

Activating 'vscode-spring-boot' extension
"spring-boot.ls.java.home" setting not specified or empty value
Found java executable: c:\Users<redacted>.vscode\extensions\redhat.java-1.25.1-win32-x64\jre\17.0.9-win32-x86_64\bin\java.exe
isJavaEightOrHigher => true
Redirecting server logs to /dev/null
Disabling server log output. No more output will be sent after this.
[Error - 5:17:48 PM] Request textDocument/codeAction failed.
Message: Internal error.
Code: -32603
java.util.concurrent.CompletionException: java.lang.StackOverflowError
at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(Unknown Source)
at java.base/java.util.concurrent.CompletableFuture.completeThrowable(Unknown Source)
at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(Unknown Source)
at java.base/java.util.concurrent.CompletableFuture$Completion.run(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.StackOverflowError
at org.eclipse.jdt.core.dom.TypeBinding.isAnonymous(TypeBinding.java:1028)
at org.eclipse.jdt.core.dom.TypeBinding.getName(TypeBinding.java:704)
at org.eclipse.jdt.core.dom.TypeBinding.getQualifiedName(TypeBinding.java:837)
at org.springframework.ide.vscode.boot.java.annotations.AnnotationHierarchies.getDirectSuperAnnotationBindings(AnnotationHierarchies.java:136)
at org.springframework.ide.vscode.boot.java.annotations.AnnotationHierarchies.findTransitiveSuperAnnotationBindings(AnnotationHierarchies.java:157)
at org.springframework.ide.vscode.boot.java.annotations.AnnotationHierarchies.lambda$findTransitiveSuperAnnotationBindings$4(AnnotationHierarchies.java:158)
at java.base/java.util.stream.ReferencePipeline$7$1.accept(Unknown Source)
at java.base/java.util.Collections$2.tryAdvance(Unknown Source)
at java.base/java.util.stream.StreamSpliterators$WrappingSpliterator.lambda$initPartialTraversalState$0(Unknown Source)
at java.base/java.util.stream.StreamSpliterators$AbstractWrappingSpliterator.fillBuffer(Unknown Source)
at java.base/java.util.stream.StreamSpliterators$AbstractWrappingSpliterator.doAdvance(Unknown Source)
at java.base/java.util.stream.StreamSpliterators$WrappingSpliterator.tryAdvance(Unknown Source)
at java.base/java.util.stream.Streams$ConcatSpliterator.tryAdvance(Unknown Source)
at java.base/java.util.stream.ReferencePipeline$7$1.accept(Unknown Source)
at java.base/java.util.Collections$2.tryAdvance(Unknown Source)

Last seven lines are repeated many times.

In Extension host log file these lines are also repeated many times:

2024-01-10 17:17:48.764 [error] [vmware.vscode-spring-boot] provider FAILED
2024-01-10 17:17:48.764 [error] Error: Internal error.
at handleResponse (c:\Users\ZZ02TY644.vscode\extensions\vmware.vscode-spring-boot-1.51.0\node_modules\vscode-jsonrpc\lib\common\connection.js:565:48)
at handleMessage (c:\Users\ZZ02TY644.vscode\extensions\vmware.vscode-spring-boot-1.51.0\node_modules\vscode-jsonrpc\lib\common\connection.js:345:13)
at processMessageQueue (c:\Users\ZZ02TY644.vscode\extensions\vmware.vscode-spring-boot-1.51.0\node_modules\vscode-jsonrpc\lib\common\connection.js:362:17)
at Immediate. (c:\Users\ZZ02TY644.vscode\extensions\vmware.vscode-spring-boot-1.51.0\node_modules\vscode-jsonrpc\lib\common\connection.js:334:13)
at process.processImmediate (node:internal/timers:476:21)

The project is based on spring boot 2.7.17, and only enabled extensions are Debugger for Java, Language Support for Java(TM) by Red Hat, Spring Boot Dashboard, Spring Boot Extension Pack, Spring Boot Tools and Spring Initializr Java Support.

@vbadev vbadev changed the title Opening Spring Boot project leads to StackOverflowError Opening Spring Boot project in VSCode leads to StackOverflowError Jan 10, 2024
@BoykoAlex
Copy link
Contributor

I hope this issue should be fixed with: d4cf735. Do you mind giving a snapshot build a try? To do so please download VSIX file for Spring Boot Tools from this page (see the bottom of the page): https://cdn.spring.io/spring-tools/snapshot/STS4/nightly-distributions.html. Then install the VSIX into the vscode via the extensions view (the ... in top right corner of the extensions section)

If this doesn't help wonder if there is a project you can share that reproduces the issue... Also include the file name of the VSIX that you've installed.
(I think though that it should really work now)

@vbadev
Copy link
Author

vbadev commented Jan 11, 2024

Snapshot version works fine and no error is displayed. Thank you for your help!

@vbadev vbadev closed this as completed Jan 11, 2024
@martinlippert martinlippert added for: eclipse something that is specific for Eclipse for: vscode something that is specific for VSCode theme: validation and removed status: waiting-for-triage labels Jan 11, 2024
@martinlippert martinlippert added this to the 4.21.1.RELEASE milestone Jan 11, 2024
@BoykoAlex
Copy link
Contributor

No problem at all - thanks for bringing this up to us!!!

@abidsutisna
Copy link

Thanksss!

@Strongbeard
Copy link

I believe this issue might have been reintroduced, or something that produces similar symptoms, in spring-boot-extension v1.55.0. Not sure about earlier versions. Here is the new stacktrace with personal info redacted. Repeating lines at the end are generated infinitely until it crashes.

Activating 'vscode-spring-boot' extension
Trying to use "spring-boot.ls.java.home" value: ██████████/.sdkman/candidates/java/17.0.11-amzn
Found java executable: ██████████/.sdkman/candidates/java/17.0.11-amzn/bin/java
isJavaEightOrHigher => true
Redirecting server logs to /dev/null
Disabling server log output. No more output will be sent after this.
[Error - 4:55:17 PM] Request textDocument/codeAction failed.
  Message: Internal error.
  Code: -32603 
java.util.concurrent.CompletionException: java.lang.StackOverflowError
	at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315)
	at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320)
	at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:649)
	at java.base/java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:482)
	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:840)
Caused by: java.lang.StackOverflowError
	at org.eclipse.jdt.core.dom.TypeBinding.isClass(TypeBinding.java:1080)
	at org.eclipse.jdt.core.dom.TypeBinding.isAnonymous(TypeBinding.java:1028)
	at org.eclipse.jdt.core.dom.TypeBinding.getName(TypeBinding.java:704)
	at org.eclipse.jdt.core.dom.TypeBinding.getQualifiedName(TypeBinding.java:837)
	at org.springframework.ide.vscode.boot.java.annotations.AnnotationHierarchies.getDirectSuperAnnotations(AnnotationHierarchies.java:54)
	at org.springframework.ide.vscode.boot.java.annotations.AnnotationHierarchies.hasTransitiveSuperAnnotationType(AnnotationHierarchies.java:90)
	at org.springframework.ide.vscode.boot.java.annotations.AnnotationHierarchies.hasTransitiveSuperAnnotationType(AnnotationHierarchies.java:92)
	at org.springframework.ide.vscode.boot.java.annotations.AnnotationHierarchies.hasTransitiveSuperAnnotationType(AnnotationHierarchies.java:92)
	at org.springframework.ide.vscode.boot.java.annotations.AnnotationHierarchies.hasTransitiveSuperAnnotationType(AnnotationHierarchies.java:92)
	at org.springframework.ide.vscode.boot.java.annotations.AnnotationHierarchies.hasTransitiveSuperAnnotationType(AnnotationHierarchies.java:92)
	at org.springframework.ide.vscode.boot.java.annotations.AnnotationHierarchies.hasTransitiveSuperAnnotationType(AnnotationHierarchies.java:92)
	at org.springframework.ide.vscode.boot.java.annotations.AnnotationHierarchies.hasTransitiveSuperAnnotationType(AnnotationHierarchies.java:92)
	at org.springframework.ide.vscode.boot.java.annotations.AnnotationHierarchies.hasTransitiveSuperAnnotationType(AnnotationHierarchies.java:92)

And here is the repeating lines from Extension Host (Remote) output:

2024-06-12 16:55:17.211 [error] [vmware.vscode-spring-boot] provider FAILED
2024-06-12 16:55:17.211 [error] Error: Internal error.
	at handleResponse (██████████/.vscode-server/extensions/vmware.vscode-spring-boot-1.55.0/node_modules/vscode-jsonrpc/lib/common/connection.js:565:48)
	at handleMessage (██████████/.vscode-server/extensions/vmware.vscode-spring-boot-1.55.0/node_modules/vscode-jsonrpc/lib/common/connection.js:345:13)
	at processMessageQueue (██████████/.vscode-server/extensions/vmware.vscode-spring-boot-1.55.0/node_modules/vscode-jsonrpc/lib/common/connection.js:362:17)
	at Immediate.<anonymous> (██████████/.vscode-server/extensions/vmware.vscode-spring-boot-1.55.0/node_modules/vscode-jsonrpc/lib/common/connection.js:334:13)
	at process.processImmediate (node:internal/timers:478:21)

@BoykoAlex
Copy link
Contributor

Lets try this fix: f14172d
To do so please download VSIX file for Spring Boot Tools from this page (see the bottom of the page): https://cdn.spring.io/spring-tools/snapshot/STS4/nightly-distributions.html. Then install the VSIX into the vscode via the extensions view (the ... in top right corner of the extensions section)

@BoykoAlex
Copy link
Contributor

Should be fixed in the snapshot or pre-release build. Polish commit: 0312d53

@BoykoAlex BoykoAlex modified the milestones: 4.24.0.RELEASE, 4.23.1 Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for: eclipse something that is specific for Eclipse for: vscode something that is specific for VSCode theme: validation type: bug
Projects
None yet
Development

No branches or pull requests

5 participants