Repository navigation
Closed
Labels
Milestone
Description
Describe the bug
After installing spring tools 4.25 from eclipse market place in eclipse 2024-09, the language server keeps restrting with folloeinf logs in console
To Reproduce
Download eclipse 2024-09, open marketplace and install spring tools 4, have a springboot project open in workspace
19:48:08.358 [main] INFO o.s.i.v.b.a.BootLanguageServerBootApp - Starting BootLanguageServerBootApp v1.57.0-SNAPSHOT using Java 21.0.4 with PID 13936 (C:\Users\ljanaswa\Applications\eclipse\plugins\org.springframework.tooling.boot.ls_1.57.0.202409101848\servers\spring-boot-language-server\spring-boot-language-server-1.57.0-SNAPSHOT-exec.jar started by LJANASWA in C:\Users\ljanaswa\Applications\eclipse)
19:48:08.364 [main] INFO o.s.i.v.b.a.BootLanguageServerBootApp - No active profile set, falling back to 1 default profile: "default"
19:48:15.305 [main] WARN o.s.c.a.AnnotationConfigApplicationContext - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'yamlPropertiesJavaDefinitionHandler': Unsatisfied dependency expressed through field 'documents': Error creating bean with name 'documents' defined in class path resource [org/springframework/ide/vscode/languageserver/starter/LanguageServerAutoConf.class]: Unsatisfied dependency expressed through method 'documents' parameter 0: Error creating bean with name 'languageServer' defined in class path resource [org/springframework/ide/vscode/languageserver/starter/LanguageServerAutoConf.class]: Failed to instantiate [org.springframework.ide.vscode.commons.languageserver.util.SimpleLanguageServer]: Factory method 'languageServer' threw exception with message: null
19:48:15.314 [main] INFO o.s.b.a.l.ConditionEvaluationReportLogger -
Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled.
19:48:15.341 [main] ERROR o.s.boot.SpringApplication - Application run failed
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'yamlPropertiesJavaDefinitionHandler': Unsatisfied dependency expressed through field 'documents': Error creating bean with name 'documents' defined in class path resource [org/springframework/ide/vscode/languageserver/starter/LanguageServerAutoConf.class]: Unsatisfied dependency expressed through method 'documents' parameter 0: Error creating bean with name 'languageServer' defined in class path resource [org/springframework/ide/vscode/languageserver/starter/LanguageServerAutoConf.class]: Failed to instantiate [org.springframework.ide.vscode.commons.languageserver.util.SimpleLanguageServer]: Factory method 'languageServer' threw exception with message: null
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:788)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:768)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:145)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:509)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1439)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:599)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:522)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:337)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:335)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:975)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:971)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:625)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:456)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:335)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1363)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1352)
at org.springframework.ide.vscode.boot.app.BootLanguageServerBootApp.main(BootLanguageServerBootApp.java:143)
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'documents' defined in class path resource [org/springframework/ide/vscode/languageserver/starter/LanguageServerAutoConf.class]: Unsatisfied dependency expressed through method 'documents' parameter 0: Error creating bean with name 'languageServer' defined in class path resource [org/springframework/ide/vscode/languageserver/starter/LanguageServerAutoConf.class]: Failed to instantiate [org.springframework.ide.vscode.commons.languageserver.util.SimpleLanguageServer]: Factory method 'languageServer' threw exception with message: null
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:795)
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:542)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1355)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1185)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:562)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:522)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:337)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:335)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200)
at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:254)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1443)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1353)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:785)
... 19 common frames omitted
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'languageServer' defined in class path resource [org/springframework/ide/vscode/languageserver/starter/LanguageServerAutoConf.class]: Failed to instantiate [org.springframework.ide.vscode.commons.languageserver.util.SimpleLanguageServer]: Factory method 'languageServer' threw exception with message: null
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:648)
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:636)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1355)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1185)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:562)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:522)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:337)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:335)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200)
at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:254)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1443)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1353)
at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:904)
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:782)
... 32 common frames omitted
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.ide.vscode.commons.languageserver.util.SimpleLanguageServer]: Factory method 'languageServer' threw exception with message: null
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:178)
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:644)
... 46 common frames omitted
Caused by: java.lang.NullPointerException: null
at org.springframework.ide.vscode.commons.util.Assert.isNotNull(Assert.java:38)
at org.springframework.ide.vscode.commons.languageserver.util.SimpleLanguageServer.<init>(SimpleLanguageServer.java:303)
at org.springframework.ide.vscode.languageserver.starter.LanguageServerAutoConf.languageServer(LanguageServerAutoConf.java:51)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:146)
... 47 common frames omitted
==== Process Terminated====
Activity
BoykoAlex commentedon Oct 4, 2024
Do you mind downloading the distro from https://spring.io/tools and trying it out? Curious to see if you'd get the same error with it...
Now, what are the contents of
C:\Users\ljanaswa\Applications\eclipseon your machine? Do you see anyapplication.ymlorapplication.propertiesfiles in there?BoykoAlex commentedon Oct 4, 2024
Do you mind trying the following:
spring-boot-language-server-1.57.0-SNAPSHOT-exec.jarunder/Eclipse/plugins/org.springframework.tooling.boot.ls_1.57.0.202409101848/serversjava -jar <the jar>from that folder. Does it start or crashes?java -jar <path to the same jar>from the folderC:\Users\ljanaswa\Applications\eclipseon your machinejlmanohar commentedon Oct 4, 2024
This is just where I unzipped the enterprise java version of eclipse 2024-09
BoykoAlex commentedon Oct 4, 2024
Okay, you didn't put anything extra in there, right? Just checking for a possible cause...
I was unable to reproduce it so far... Everything worked fine on mac. I've tried Win 10 machine but wasn't able to install sts via update site... some proxy issue I suppose, not sure... but the issue doen't seem to be platform related to me...
Please try launching the JAR as described above if you can :-)
jlmanohar commentedon Oct 4, 2024
Sure, let me retry and get back.
I doubt I may have a corrupted install for some reason, though the other features of sts4 like dashboard works just fine.
If launching standalone doesn't work, I will try out a fresh install in some different folder too and get back.
jlmanohar commentedon Oct 4, 2024
And no, the root folder has no modifications, eclipse ini... And all other files are stock, though I have sonarqube and jboss tools as extra plugins from marketplace, not sure if it will impact it though as their features work just fine
jlmanohar commentedon Oct 5, 2024
I dont have java 21 installed, so i used the same jre that comes pre installed with eclipse and its the same error. The hash of the jar is as follows
SHA1:
61233b94b1b26a958817ae5ff374341228d39981jlmanohar commentedon Oct 5, 2024
Does it depend on something from the windows os ? i am on this version of windows on the system having issues

jlmanohar commentedon Oct 5, 2024
Hmm, seems weird, i copied the exact installation as zip in my personal laptop and it seems to be working. So looks like compatability issue with older versions of windows. Are you aware of such requirement ?
personal laptop windows version:

BoykoAlex commentedon Oct 6, 2024
I don't know if there is a compatibility issue but I wouldn't be surprised if there is... I have an old Windows 10 machine version 22H2 (installed in 2020) and was able to test this on it today - worked just fine. Version 1803 seems rather old. It is the new JAR layout that we are using with the language server JAR executable and likely there is something missing or being old in the platform to work with it.
The NPE from the stack trace is language server id being
null. This id comes from theapplication.propertiesfile inside the language server JAR. For some reason spring doesn't pick up that properties file in the case of the old Win. Not sure why that is...20 remaining items
martinlippert commentedon Oct 10, 2024
@jlmanohar Can you take a look at the environment variables that are set on your machine where the app doesn't start correctly? Is there anything included starting with
SPRING_orspring.? And if so, can you paste those ENV VARs here? Would be interesting to see if something is set there that drives the boot app to not lookup the application properties in the right place automatically.jlmanohar commentedon Oct 10, 2024
Oops, I do have a evn var on the system causing trouble
SPRING_CONFIG_LOCATION=file:///H:/properties/, this has my multiple spring projects individual properties app1.prop, app2.prop etc.....My bad, i totally forgot abt that. We don't check in prop in source but instead use external config, so we use that env var. In older versions of sts, since its exploded and not a jar, it doesnt use this var ?
jlmanohar commentedon Oct 10, 2024
@martinlippert
Update: If i remove the env var and restart eclipse, language server starts fine without issues. So I guess its not really an issue with old windows.
But should the vmarg fix suggested by @BoykoAlex still be added so that language server doesn't depend on developer's setup for running spring apps ?
martinlippert commentedon Oct 10, 2024
I am still not sure about adding the system property for the spring config location. It sounds to me like there could be random environment variables influencing the way the language server boot app runs, so maybe we need to start it with a clean environment and not inherit any vars from the environment instead? Hmmm... 🤔
jlmanohar commentedon Oct 10, 2024
Sorry, closed the issue by mistake
Yes, I agree that variables/ config not part of the IDE should not influence how the language server starts up. but unfortunately I am not well versed in that field to suggest changes.
I am not sure what all vars are required for a language server but HOME seems like it does get used as i see $HOME/.sts4 directory that might be created by the plugin since it has some files that look like cache files.
martinlippert commentedon Oct 10, 2024
And thanks @jlmanohar for double checking and testing all the things all the time. I am glad that we found the root cause of this here.
jlmanohar commentedon Oct 10, 2024
Thanks @martinlippert / @BoykoAlex ,
Let me update the issue with the actual issue instead of the initial assumption about old windows
[-]Spring Boot language server doesn't start and keeps restarting on eclipse 2024-09 (On older version of Windows 10)[/-][+]Spring Boot language server doesn't start when spring.config.location variable is set with custom location in environment[/+]BoykoAlex commentedon Oct 10, 2024
There are proxy url settings that we attempt to lookup in the environment... We could of course just copy these settings into the blank environment we'd use to launch LS
I'm a bit afraid wiping out environment for the LS process... I'd rather strictly set the properties file path for the process...
martinlippert commentedon Oct 11, 2024
@BoykoAlex Okay, let's go with setting the properties file path when launching the process.
BoykoAlex commentedon Oct 11, 2024
Fixed via 7532aa3