cypher256 / pleiades.io

Pleiades による Eclipse などの IDE 製品翻訳や JetBrains 製品のオンラインヘルプ日本語サイト https://pleiades.io や https://spring.pleiades.io の誤訳や問題を管理します。
https://willbrains.jp/
27 stars 2 forks source link

Springのプロパティエディタ/YAMLエディタでコンテンツアシストが効かない #35

Closed hirokazuk closed 5 years ago

hirokazuk commented 5 years ago

■現象

以下のpleiades環境でSpringのプロパティエディタ(Spring Properties)やYAMLエディタ(Spring YAML Properties)共にコンテンツアシスト等の機能が効かない

以下は動作しました

参考までに、 Spring Tools 4 for Eclipseの以下のバージョン上で動作しました。

■再現手順

新規でSpring Bootプロジェクトを作成後 application.propertiesを汎用エディターSpringPropertiesで開いて 「server.」と打った後に補完を要求しても補完項目のエリアに以下のようなエラーが表示され補完ができない contentAssistErr 言語サーバ->Spring言語サーバのSpringBootのチェックを入れてコンソール「SpringBootLanguageServer」を選択すると のようなエラーが出ている 以下エラーは pleiades-2019-09-java-win-64bit-jre_20190930 にて取得

16:36:54.175 [main] INFO  o.s.i.v.b.a.BootLanguagServerBootApp - Starting BootLanguagServerBootApp on D88XA044 with PID 18832 (C:\pleiades20190930\eclipse\dropins\STS\eclipse\plugins\org.springframework.tooling.boot.ls_1.11.0.201909171347\servers\spring-boot-language-server\BOOT-INF\classes started by Y544YUE in C:\pleiades20190930\eclipse)
16:36:54.177 [main] INFO  o.s.i.v.b.a.BootLanguagServerBootApp - No active profile set, falling back to default profiles: default
16:36:54.613 [main] INFO  o.s.i.v.b.jdt.ls.JdtLsProjectCache - added listener - now listeners registered: 1
16:36:54.625 [main] INFO  o.s.i.v.b.j.l.JavaProjectsServiceWithFallback - set fallback shutdown handler
16:36:54.725 [main] INFO  o.s.i.v.boot.app.SpringSymbolIndex - project listener registered
16:36:54.735 [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 [jdk.internal.loader.ClassLoaders$AppClassLoader@6659c656]
16:36:54.746 [main] INFO  o.s.b.a.l.ConditionEvaluationReportLoggingListener - 

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
16:36:54.754 [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 [jdk.internal.loader.ClassLoaders$AppClassLoader@6659c656]
    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 [jdk.internal.loader.ClassLoaders$AppClassLoader@6659c656]
    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 [jdk.internal.loader.ClassLoaders$AppClassLoader@6659c656]
    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.base/java.lang.Class.getDeclaredMethods0(Native Method)
    at java.base/java.lang.Class.privateGetDeclaredMethods(Class.java:3166)
    at java.base/java.lang.Class.getDeclaredMethods(Class.java:2309)
    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.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
    at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
    ... 38 common frames omitted
==== Process Terminated====
cypher256 commented 5 years ago

pleiades-2019-09-java-win-64bit-jre_20190930 pleiades-2019-09-java-mac-jre_20190930

上記で下記のように補完が動作しました。 後日、他の環境でも試してみます。

setting

comp

hirokazuk commented 5 years ago

他のWindows端末でも同様の事象が発生したので、ideの側に原因があると思ったのですが、 cypher256さんの環境では正常に補完ができるということは、 我々の環境を疑った方が良さそうですね。

https://github.com/spring-projects/sts4/issues/370#issuecomment-534398777 近しい事象を見つけましたので、いま一度、pleiadesの展開からやり直してみます

hirokazuk commented 5 years ago

アーカイバを変えることで解決しました。

7-zip portable 19.00にて解凍したところ動作しました。 STS系はC:\直下に解凍してもパス長が260を少々オーバーしてしまうのですね。

Lhaz64 Version 2.5.1にて、C:\直下に解凍したところ、エラーなどは出ませんでしたが、 7zipで解凍したものと比較した結果、以下のファイルが存在しませんでした。

C:\pleiades\eclipse\dropins\STS\eclipse\plugins\org.springframework.tooling.boot.ls_1.11.0.201909171347\servers\spring-boot-language-server\BOOT-INF\classes\org\springframework\ide\vscode\boot\configurationmetadata\ConfigurationMetadataRepositoryJsonBuilder.class
C:\pleiades\eclipse\dropins\STS\eclipse\plugins\org.springframework.tooling.boot.ls_1.11.0.201909171347\servers\spring-boot-language-server\BOOT-INF\classes\org\springframework\ide\vscode\boot\java\livehover\AbstractInjectedIntoHoverProvider$DefinedBeanProvider.class
C:\pleiades\eclipse\dropins\STS\eclipse\plugins\org.springframework.tooling.boot.ls_1.11.0.201909171347\servers\spring-boot-language-server\BOOT-INF\classes\org\springframework\ide\vscode\boot\metadata\AdHocSpringPropertyIndexProvider$SimplePropertyIndex.class
C:\pleiades\eclipse\dropins\STS\eclipse\plugins\org.springframework.tooling.boot.ls_1.11.0.201909171347\servers\spring-boot-language-server\BOOT-INF\classes\org\springframework\ide\vscode\boot\properties\completions\PropertiesCompletionProposalsCalculator$1.class
C:\pleiades\eclipse\dropins\STS\eclipse\plugins\org.springframework.tooling.boot.ls_1.11.0.201909171347\servers\spring-boot-language-server\BOOT-INF\classes\org\springframework\ide\vscode\boot\properties\completions\PropertiesCompletionProposalsCalculator$2.class
C:\pleiades\eclipse\dropins\STS\eclipse\plugins\org.springframework.tooling.boot.ls_1.11.0.201909171347\servers\spring-boot-language-server\BOOT-INF\classes\org\springframework\ide\vscode\boot\properties\completions\PropertiesCompletionProposalsCalculator$3.class
C:\pleiades\eclipse\dropins\STS\eclipse\plugins\org.springframework.tooling.boot.ls_1.11.0.201909171347\servers\spring-boot-language-server\BOOT-INF\classes\org\springframework\ide\vscode\boot\properties\completions\PropertiesCompletionProposalsCalculator.class
C:\pleiades\eclipse\dropins\STS\eclipse\plugins\org.springframework.tooling.cloudfoundry.manifest.ls_1.11.0.201909171347\servers\manifest-yaml-language-server\BOOT-INF\classes\org\springframework\ide\vscode\manifest\yaml\ManifestYamlLanguageServerBootApp.class
C:\pleiades\eclipse\dropins\STS\eclipse\plugins\org.springframework.tooling.cloudfoundry.manifest.ls_1.11.0.201909171347\servers\manifest-yaml-language-server\BOOT-INF\classes\org\springframework\ide\vscode\manifest\yaml\ManifestYamlLanguageServerInitializer$1.class
C:\pleiades\eclipse\dropins\STS\eclipse\plugins\org.springframework.tooling.cloudfoundry.manifest.ls_1.11.0.201909171347\servers\manifest-yaml-language-server\BOOT-INF\classes\org\springframework\ide\vscode\manifest\yaml\ManifestYamlLanguageServerInitializer.class
C:\pleiades\eclipse\dropins\STS\eclipse\plugins\org.springframework.tooling.concourse.ls_1.11.0.201909171347\servers\concourse-language-server\BOOT-INF\classes\org\springframework\ide\vscode\concourse\ConcourseLanguageServerInitializer$SchemaSpecificPieces.class