spring-attic / spring-ide

Spring Development Environment for Eclipse
299 stars 126 forks source link

sts 3.9.10 can't open the application.yml file #397

Closed DustinLWQ closed 4 years ago

DustinLWQ commented 4 years ago

with an error Plug-in "org.springframework.ide.eclipse.boot.properties.editor.yaml" was unable to instantiate class "org.springframework.ide.eclipse.boot.properties.editor.yaml.SpringYamlEditor".

org.eclipse.core.runtime.CoreException: Plug-in "org.springframework.ide.eclipse.boot.properties.editor.yaml" was unable to instantiate class "org.springframework.ide.eclipse.boot.properties.editor.yaml.SpringYamlEditor". at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.throwException(RegistryStrategyOSGI.java:212) at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:206) at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:934) at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:246) at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:63) at org.eclipse.ui.internal.WorkbenchPlugin.createExtension(WorkbenchPlugin.java:280) at org.eclipse.ui.internal.registry.EditorDescriptor.createEditor(EditorDescriptor.java:231) at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:321) at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.createPart(CompatibilityPart.java:300) at org.eclipse.ui.internal.e4.compatibility.CompatibilityEditor.createPart(CompatibilityEditor.java:61) at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.create(CompatibilityPart.java:338) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:58) at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:998) at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:963) at org.eclipse.e4.core.internal.di.InjectorImpl.internalInject(InjectorImpl.java:139) at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:408) at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:331) at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:202) at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:91) at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:60) at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:42) at org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRenderer.createWidget(ContributedPartRenderer.java:132) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createWidget(PartRenderingEngine.java:1002) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:662) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:768) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$0(PartRenderingEngine.java:739) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run(PartRenderingEngine.java:733) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:717) at org.eclipse.e4.ui.internal.workbench.PartServiceImpl$1.handleEvent(PartServiceImpl.java:107) at org.eclipse.e4.ui.services.internal.events.UIEventHandler.lambda$0(UIEventHandler.java:38) at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:236) at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:146) at org.eclipse.swt.widgets.Display.syncExec(Display.java:4622) at org.eclipse.e4.ui.internal.workbench.swt.E4Application$1.syncExec(E4Application.java:219) at org.eclipse.e4.ui.services.internal.events.UIEventHandler.handleEvent(UIEventHandler.java:38) at org.eclipse.equinox.internal.event.EventHandlerWrapper.handleEvent(EventHandlerWrapper.java:205) at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:203) at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:1) at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:234) at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:151) at org.eclipse.equinox.internal.event.EventAdminImpl.dispatchEvent(EventAdminImpl.java:132) at org.eclipse.equinox.internal.event.EventAdminImpl.sendEvent(EventAdminImpl.java:75) at org.eclipse.equinox.internal.event.EventComponent.sendEvent(EventComponent.java:44) at org.eclipse.e4.ui.services.internal.events.EventBroker.send(EventBroker.java:55) at org.eclipse.e4.ui.internal.workbench.UIEventPublisher.notifyChanged(UIEventPublisher.java:63) at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:424) at org.eclipse.e4.ui.model.application.ui.impl.ElementContainerImpl.setSelectedElementGen(ElementContainerImpl.java:170) at org.eclipse.e4.ui.model.application.ui.impl.ElementContainerImpl.setSelectedElement(ElementContainerImpl.java:188) at org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.showElementInWindow(ModelServiceImpl.java:651) at org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.bringToTop(ModelServiceImpl.java:615) at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.delegateBringToTop(PartServiceImpl.java:790) at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.bringToTop(PartServiceImpl.java:404) at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.showPart(PartServiceImpl.java:1239) at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:3205) at org.eclipse.ui.internal.WorkbenchPage.lambda$9(WorkbenchPage.java:3110) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:72) at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:3108) at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:3078) at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:3069) at org.eclipse.ui.ide.IDE.openEditor(IDE.java:570) at org.eclipse.ui.ide.IDE.openEditor(IDE.java:525) at org.eclipse.ui.actions.OpenFileAction.openFile(OpenFileAction.java:103) at org.eclipse.ui.actions.OpenSystemEditorAction.run(OpenSystemEditorAction.java:96) at org.eclipse.ui.views.navigator.OpenActionGroup.runDefaultAction(OpenActionGroup.java:134) at org.eclipse.ui.views.navigator.MainActionGroup.runDefaultAction(MainActionGroup.java:307) at org.eclipse.ui.views.navigator.ResourceNavigator.handleOpen(ResourceNavigator.java:771) at org.eclipse.ui.views.navigator.ResourceNavigator$2.open(ResourceNavigator.java:488) at org.eclipse.ui.OpenAndLinkWithEditorHelper$InternalListener.open(OpenAndLinkWithEditorHelper.java:48) at org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredViewer.java:797) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) at org.eclipse.ui.internal.JFaceUtil.lambda$0(JFaceUtil.java:47) at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:174) at org.eclipse.jface.viewers.StructuredViewer.fireOpen(StructuredViewer.java:794) at org.eclipse.jface.viewers.StructuredViewer.handleOpen(StructuredViewer.java:1110) at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrategy.java:275) at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.java:270) at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:310) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89) at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4173) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1057) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3986) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3585) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1160) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1049) at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155) at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:633) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:557) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:150) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:660) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:597) at org.eclipse.equinox.launcher.Main.run(Main.java:1468) Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:204) ... 106 more Caused by: java.lang.NoClassDefFoundError: javax/inject/Provider at org.springframework.ide.eclipse.boot.properties.editor.yaml.ApplicationYamlSourceViewerConfiguration.(ApplicationYamlSourceViewerConfiguration.java:69) at org.springframework.ide.eclipse.boot.properties.editor.yaml.SpringYamlEditor.createSourceViewerConfiguration(SpringYamlEditor.java:28) at org.dadacoalition.yedit.editor.YEdit.initializeEditor(YEdit.java:81) at org.springframework.ide.eclipse.boot.properties.editor.yaml.SpringYamlEditor.initializeEditor(SpringYamlEditor.java:33) at org.eclipse.ui.texteditor.AbstractDecoratedTextEditor.(AbstractDecoratedTextEditor.java:352) at org.eclipse.ui.editors.text.TextEditor.(TextEditor.java:62) at org.dadacoalition.yedit.editor.YEdit.(YEdit.java:46) at org.springframework.ide.eclipse.editor.support.yaml.AbstractYamlEditor.(AbstractYamlEditor.java:19) at org.springframework.ide.eclipse.boot.properties.editor.yaml.SpringYamlEditor.(SpringYamlEditor.java:22) ... 111 more Caused by: java.lang.ClassNotFoundException: javax.inject.Provider cannot be found by org.springframework.ide.eclipse.editor.support_3.9.10.201909171046-RELEASE at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:514) at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:425) at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417) at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:155) at java.lang.ClassLoader.loadClass(Unknown Source) ... 120 more

martinlippert commented 4 years ago

That looks bad. You mentioned that you use STS 3.9.10. Do you use a STS 3.9.10 distribution download or did you install STS3 components into an existing Eclipse install? And did you install other third-party add-ons?

One way to investigate this in more detail would be:

Another important fact might be the JDK version that you use to run the IDE. Is that a JDK8 or a newer one? What happens if you switch to run the IDE on a JDK8? (you can still use JDK9/10/11/12 projects and JREs in your workspace).

Another thing you might want to try is to re-start the IDE with then -clean option from the command line to see if that makes a difference.

So lets see if anything here helps and/or provides more insights into the issue.

DustinLWQ commented 4 years ago

That looks bad. You mentioned that you use STS 3.9.10. Do you use a STS 3.9.10 distribution download or did you install STS3 components into an existing Eclipse install? And did you install other third-party add-ons?

One way to investigate this in more detail would be:

* open the console view

* switch to "Host OSGi Console"

* type in "ss" and hit enter

* look out for bundles in the "INSTALLED" state

* if you find one, hit "diag " and see what the result is

Another important fact might be the JDK version that you use to run the IDE. Is that a JDK8 or a newer one? What happens if you switch to run the IDE on a JDK8? (you can still use JDK9/10/11/12 projects and JREs in your workspace).

Another thing you might want to try is to re-start the IDE with then -clean option from the command line to see if that makes a difference.

So lets see if anything here helps and/or provides more insights into the issue.

I use STS 3.9.10 distribution download with JDK8 and there is no bundles in the "INSTALLED" state. Now I use the STS 3.9.9 distribution download with JDK8 , and it works.

kdvolder commented 4 years ago

I vaguely recall a recent issue with resolving types from javax.inject and adjusting some dependencies in some of our bundles to compensate. I think maybe something changed in Eclipse bundles where we used to get these types somehow implicitly but this is no longer the case.

See this commit: https://github.com/spring-projects/spring-ide/commit/6c98f3982c053b4c9f2d27cd3aba947f15e6a3ae

This commit went in after 3.9.10 release. So I suspect that this issue is probably fixed in our nightly builds already, but 3.9.10 does have the issue.

@DustinLWQ would you mind giving nightly build a try to see if this solves the issue for you? You can download a nighly build from here:

https://dist.springsource.com/snapshot/STS/nightly-distributions.html

DustinLWQ commented 4 years ago

I vaguely recall a recent issue with resolving types from javax.inject and adjusting some dependencies in some of our bundles to compensate. I think maybe something changed in Eclipse bundles where we used to get these types somehow implicitly but this is no longer the case.

See this commit: 6c98f39

This commit went in after 3.9.10 release. So I suspect that this issue is probably fixed in our nightly builds already, but 3.9.10 does have the issue.

@DustinLWQ would you mind giving nightly build a try to see if this solves the issue for you? You can download a nighly build from here:

https://dist.springsource.com/snapshot/STS/nightly-distributions.html

I tried the nightly build, and it works.

kdvolder commented 4 years ago

I tried the nightly build, and it works.

Great! I'm glad that worked, and thanks for letting us know.