Skip to content

STS 4 Hanging while using CTRL + click #370

Closed

Description

@hdkrish

STS is taking approximate 4-8 secs to open the implementation of Interfaces. Sometimes it's freeze.
Please help me to resolve this issue.

Activity

  1. martinlippert commented on Sep 23, 2019

    @martinlippert
    Member

    @hdkrish please provide more details like the version of STS4 you are using, the environment you are running the tools in and on (Eclipse, VSCode, Theia, operating system, JDK, etc.). And maybe a few steps how to reproduce the issue. If you have a sample project that could help us to reproduce the issue would awesome, too.

    In addition to that you could also try to capture a thread dump (uns jps and jstack) at the exact moment it is slow or freezing for you, that could help a lot, too. Might be a bit tricky to hit the right moment, but identifying the process ID upfront might help with that.

    Lockig forward to more details, as we are extremely interested in solving those issues as quickly as possible.

  2. added this to the 4.4.1.RELEASE milestone on Sep 23, 2019
  3. hdkrish commented on Sep 23, 2019

    @hdkrish
    Author

    STS information

    image

    Java Version
    image

    Ctrl + hover or Ctrl + click over method names such as withCatalogName in below example or any Interface implementation. It will freeze the IDE for 5-8 secs and Hang the IDE

    image

    Please let me know any other information needed

  4. BoykoAlex commented on Sep 23, 2019

    @BoykoAlex
    Contributor

    Which version of Eclipse is it? 4.12 or 4.13?
    Can you give the latest STS 4.4.0 a try?
    Turn on Boot Language Server logging in the console. Preferences -> Language Servers -> Spring Language Servers page. Check-mark Spring Boot. Close all editors. Open your Java file. Now you should see the Spring Boot LS log in the console. Now try Ctrl-Click. Copy paste log entries that occurred while STS was stuck... Another thing to do would be to provide us the VisualVM CPU sampling file for Eclipse process and also for the Boot LS process. If you are not sure how to proceed with VisualVM please let me know I provide you with instructions.

    Meanwhile I'll try you use case on Win10 with the latest STS 4.4.0 on Eclipse 4.13...

  5. BoykoAlex commented on Sep 23, 2019

    @BoykoAlex
    Contributor

    Works fine for me on Win10 with STS 4.4.0 based on Eclipse 4.13. The very first time right after startup it took time before hyperlinks started to show up. However, that is expected because JDT indexing is still in progress. After that I see hyperlinks showing up right away and navigate to definition right away as well.

  6. hdkrish commented on Sep 24, 2019

    @hdkrish
    Author

    Please find the eclipse version

    image

    Please find the video recording below
    STS hanging issue.zip

    Let me know what else is required

  7. hdkrish commented on Sep 24, 2019

    @hdkrish
    Author

    Which version of Eclipse is it? 4.12 or 4.13?
    Can you give the latest STS 4.4.0 a try?
    Turn on Boot Language Server logging in the console. Preferences -> Language Servers -> Spring Language Servers page. Check-mark Spring Boot. Close all editors. Open your Java file. Now you should see the Spring Boot LS log in the console. Now try Ctrl-Click. Copy paste log entries that occurred while STS was stuck... Another thing to do would be to provide us the VisualVM CPU sampling file for Eclipse process and also for the Boot LS process. If you are not sure how to proceed with VisualVM please let me know I provide you with instructions.

    Meanwhile I'll try you use case on Win10 with the latest STS 4.4.0 on Eclipse 4.13...

    Please find the below error log found in Spring boot LS
    11:12:56.249 [main] INFO o.s.i.v.b.a.BootLanguagServerBootApp - Starting BootLanguagServerBootApp on DESKTOP-HA36M3V with PID 13168 (C:\Hemant_Document\STS\sts-4.3.2.RELEASE\plugins\org.springframework.tooling.boot.ls_1.10.0.201908130624\servers\spring-boot-language-server\BOOT-INF\classes started by HemantDubey in C:\Hemant_Document\STS\sts-4.3.2.RELEASE)
    11:12:56.254 [main] INFO o.s.i.v.b.a.BootLanguagServerBootApp - No active profile set, falling back to default profiles: default
    11:12:57.370 [main] INFO o.s.i.v.b.jdt.ls.JdtLsProjectCache - added listener - now listeners registered: 1
    11:12:57.577 [main] INFO o.s.i.v.boot.app.SpringSymbolIndex - project listener registered
    11:12:57.586 [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 'bootLanguageServerInitializer': Unsatisfied dependency expressed through field 'adHocProperties'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'adHocProperties' defined in org.springframework.ide.vscode.boot.app.BootLanguagServerBootApp: Post-processing of merged bean definition failed; nested exception is java.lang.IllegalStateException: Failed to introspect Class [org.springframework.ide.vscode.boot.metadata.AdHocSpringPropertyIndexProvider] from ClassLoader [sun.misc.Launcher$AppClassLoader@73d16e93]
    11:12:57.594 [main] INFO o.s.b.a.l.ConditionEvaluationReportLoggingListener -

    Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
    11:12:57.603 [main] ERROR o.s.boot.SpringApplication - Application run failed
    org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'bootLanguageServerInitializer': Unsatisfied dependency expressed through field 'adHocProperties'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'adHocProperties' defined in org.springframework.ide.vscode.boot.app.BootLanguagServerBootApp: Post-processing of merged bean definition failed; nested exception is java.lang.IllegalStateException: Failed to introspect Class [org.springframework.ide.vscode.boot.metadata.AdHocSpringPropertyIndexProvider] from ClassLoader [sun.misc.Launcher$AppClassLoader@73d16e93]
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:626)
    at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:116)
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:385)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1415)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:592)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515)
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:866)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:877)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549)
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:782)
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:404)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:319)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1275)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1263)
    at org.springframework.ide.vscode.boot.app.BootLanguagServerBootApp.main(BootLanguagServerBootApp.java:84)
    Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'adHocProperties' defined in org.springframework.ide.vscode.boot.app.BootLanguagServerBootApp: Post-processing of merged bean definition failed; nested exception is java.lang.IllegalStateException: Failed to introspect Class [org.springframework.ide.vscode.boot.metadata.AdHocSpringPropertyIndexProvider] from ClassLoader [sun.misc.Launcher$AppClassLoader@73d16e93]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:570)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515)
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
    at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:277)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1264)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1184)
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:623)
    ... 18 common frames omitted
    Caused by: java.lang.IllegalStateException: Failed to introspect Class [org.springframework.ide.vscode.boot.metadata.AdHocSpringPropertyIndexProvider] from ClassLoader [sun.misc.Launcher$AppClassLoader@73d16e93]
    at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:476)
    at org.springframework.util.ReflectionUtils.doWithLocalMethods(ReflectionUtils.java:317)
    at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.buildLifecycleMetadata(InitDestroyAnnotationBeanPostProcessor.java:232)
    at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.findLifecycleMetadata(InitDestroyAnnotationBeanPostProcessor.java:210)
    at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessMergedBeanDefinition(InitDestroyAnnotationBeanPostProcessor.java:149)
    at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessMergedBeanDefinition(CommonAnnotationBeanPostProcessor.java:309)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyMergedBeanDefinitionPostProcessors(AbstractAutowireCapableBeanFactory.java:1081)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:567)
    ... 27 common frames omitted
    Caused by: java.lang.NoClassDefFoundError: org/springframework/ide/vscode/boot/metadata/AdHocSpringPropertyIndexProvider$SimplePropertyIndex
    at java.lang.Class.getDeclaredMethods0(Native Method)
    at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
    at java.lang.Class.getDeclaredMethods(Class.java:1975)
    at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:458)
    ... 34 common frames omitted
    Caused by: java.lang.ClassNotFoundException: org.springframework.ide.vscode.boot.metadata.AdHocSpringPropertyIndexProvider$SimplePropertyIndex
    at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 38 common frames omitted
    ==== Process Terminated====

  8. hdkrish commented on Sep 25, 2019

    @hdkrish
    Author

    @BoykoAlex, Please help me with step to solve the problem. This is issue is really very frustrating. Your above comment didn't help me.

  9. martinlippert commented on Sep 25, 2019

    @martinlippert
    Member

    @hdkrish In order to workaround the issue you can disable the Spring Boot Language Server for Java files via the preferences: Preferences -> Language Servers, then de-select the Spring Boot Language Server for the Java source file type. That should work as a workaround.

  10. martinlippert commented on Sep 25, 2019

    @martinlippert
    Member

    Maybe this is caused by some classes missing from the installation due to errors while unzipping the distribution. Did you do this using the Windows built-in ZIP support? That probably caused several files not to be stored in the right place - causing the issue above.

    You should definitely wipe out your installation and create a new one by using these instructions: https://github.com/spring-projects/sts4/wiki/Installation - does that help?

  11. hdkrish commented on Sep 26, 2019

    @hdkrish
    Author

    @martinlippert, Re-installation using 7zip help me to resolve this issue. Thanks for your support.

  12. martinlippert commented on Sep 30, 2019

    @martinlippert
    Member

    @hdkrish Happy to hear that this solved your issue and thanks for letting us know. We definitely need to investigate how we can avoid this kind of install issue on Windows in the future.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions