Skip to content

Spring Boot language server doesn't start when spring.config.location variable is set with custom location in environment #1367

Closed

Description

@jlmanohar

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

  1. BoykoAlex commented on Oct 4, 2024

    @BoykoAlex
    Contributor

    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\eclipse on your machine? Do you see any application.yml or application.properties files in there?

  2. BoykoAlex commented on Oct 4, 2024

    @BoykoAlex
    Contributor

    Do you mind trying the following:

    1. Locate the spring-boot-language-server-1.57.0-SNAPSHOT-exec.jar under /Eclipse/plugins/org.springframework.tooling.boot.ls_1.57.0.202409101848/servers
    2. Try executing java -jar <the jar> from that folder. Does it start or crashes?
    3. If starts up fine try java -jar <path to the same jar> from the folder C:\Users\ljanaswa\Applications\eclipse on your machine
  3. jlmanohar commented on Oct 4, 2024

    @jlmanohar
    Author

    Now, what are the contents of C:\Users\ljanaswa\Applications\eclipse on your machine? Do you see any application.yml or application.properties files in there?

    This is just where I unzipped the enterprise java version of eclipse 2024-09

  4. BoykoAlex commented on Oct 4, 2024

    @BoykoAlex
    Contributor

    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 :-)

  5. jlmanohar commented on Oct 4, 2024

    @jlmanohar
    Author

    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.

  6. jlmanohar commented on Oct 4, 2024

    @jlmanohar
    Author

    Okay, you didn't put anything extra in there, right? Just checking for a possible cause...

    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

  7. jlmanohar commented on Oct 5, 2024

    @jlmanohar
    Author

    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: 61233b94b1b26a958817ae5ff374341228d39981

    PS C:\Users\ljanaswa\Applications\eclipse\plugins\org.springframework.tooling.boot.ls_1.57.0.202409101848\servers\spring-boot-language-server> C:\Users\ljanaswa\Applications\eclipse\plugins\org.eclipse.justj.openjdk.hotspot.jre.full.win32.x86_64_21.0.4.v20240802-1551\jre\bin\java.exe -jar .\spring-boot-language-server-1.57.0-SNAPSHOT-exec.jar
    
      .   ____          _            __ _ _
     /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
    ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
     \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
      '  |____| .__|_| |_|_| |_\__, | / / / /
     =========|_|==============|___/=/_/_/_/
    
     :: Spring Boot ::                (v3.3.3)
    
    19:46:44.401 [main] INFO  o.s.i.v.b.a.BootLanguageServerBootApp - Starting BootLanguageServerBootApp v1.57.0-SNAPSHOT using Java 21.0.4 with PID 13232 (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\plugins\org.springframework.tooling.boot.ls_1.57.0.202409101848\servers\spring-boot-language-server)
    19:46:44.404 [main] INFO  o.s.i.v.b.a.BootLanguageServerBootApp - No active profile set, falling back to 1 default profile: "default"
    19:46:45.879 [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:46:45.888 [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:46:45.930 [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
    
  8. jlmanohar commented on Oct 5, 2024

    @jlmanohar
    Author

    Does it depend on something from the windows os ? i am on this version of windows on the system having issues
    image

  9. jlmanohar commented on Oct 5, 2024

    @jlmanohar
    Author

    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 ?

    PS C:\Users\jlgpr\Downloads\eclipse\plugins\org.springframework.tooling.boot.ls_1.57.0.202409101848\servers\spring-boot-language-server> ..\..\..\org.eclipse.justj.openjdk.hotspot.jre.full.win32.x86_64_21.0.4.v20240802-1551\jre\bin\java.exe -jar .\spring-boot-language-server-1.57.0-SNAPSHOT-exec.jar
    20:32:30.366 [main] INFO  o.s.i.v.b.a.BootLanguageServerBootApp - Starting BootLanguageServerBootApp v1.57.0-SNAPSHOT using Java 21.0.4 with PID 15792 (C:\Users\jlgpr\Downloads\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 jlgpr in C:\Users\jlgpr\Downloads\eclipse\plugins\org.springframework.tooling.boot.ls_1.57.0.202409101848\servers\spring-boot-language-server)
    20:32:30.366 [main] INFO  o.s.i.v.b.a.BootLanguageServerBootApp - No active profile set, falling back to 1 default profile: "default"
    20:32:31.934 [main] INFO  o.s.i.v.boot.app.SpringSymbolIndex - project listener registered
    20:32:32.329 [main] INFO  o.s.i.v.b.a.BootLanguageServerBootApp - Started BootLanguageServerBootApp in 2.695 seconds (process running for 3.812)
    20:32:32.337 [main] INFO  o.s.i.v.c.l.LanguageServerRunner - java.home = C:\Users\jlgpr\Downloads\eclipse\plugins\org.eclipse.justj.openjdk.hotspot.jre.full.win32.x86_64_21.0.4.v20240802-1551\jre
    20:32:32.338 [LanguageServerApp-lifecycle] INFO  o.s.i.v.c.l.LanguageServerRunner - Server ready to start after 3821 ms
    20:32:32.338 [LanguageServerApp-lifecycle] INFO  o.s.i.v.c.l.LanguageServerRunner - Starting LS as client
    20:32:32.338 [LanguageServerApp-lifecycle] INFO  o.s.i.v.c.l.LanguageServerRunner - Connected to parent using stdio
    

    personal laptop windows version:
    image

  10. BoykoAlex commented on Oct 6, 2024

    @BoykoAlex
    Contributor

    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 the application.properties file 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...

  11. 20 remaining items

  12. martinlippert commented on Oct 10, 2024

    @martinlippert
    Member

    @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_ or spring. ? 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.

  13. jlmanohar commented on Oct 10, 2024

    @jlmanohar
    Author

    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 ?

  14. jlmanohar commented on Oct 10, 2024

    @jlmanohar
    Author

    @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 ?

  15. martinlippert commented on Oct 10, 2024

    @martinlippert
    Member

    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... 🤔

  16. jlmanohar commented on Oct 10, 2024

    @jlmanohar
    Author

    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.

  17. martinlippert commented on Oct 10, 2024

    @martinlippert
    Member

    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.

  18. jlmanohar commented on Oct 10, 2024

    @jlmanohar
    Author

    Thanks @martinlippert / @BoykoAlex ,

    Let me update the issue with the actual issue instead of the initial assumption about old windows

  19. changed the title [-]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[/+] on Oct 10, 2024
  20. BoykoAlex commented on Oct 10, 2024

    @BoykoAlex
    Contributor

    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... 🤔

    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...

  21. martinlippert commented on Oct 11, 2024

    @martinlippert
    Member

    @BoykoAlex Okay, let's go with setting the properties file path when launching the process.

  22. BoykoAlex commented on Oct 11, 2024

    @BoykoAlex
    Contributor

    Fixed via 7532aa3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

for: eclipsetype: bugtype: install-issue

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions