打开STS时,我始终得到以下错误。为了重现,我在编辑器中打开了一个bean配置文件,然后退出STS。然后我重新打开STS并抛出此异常并且我打开的编辑器无法正常启动。
如果我关闭编辑器抛出错误然后重新打开它(不重新启动STS),编辑器就可以打开了。但是当重新启动STS时,它仍会抛出此错误。
我的bean配置的内容主要是Spring Integration元素。以下是我使用的模式:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:int="http://www.springframework.org/schema/integration"
xmlns:int-file="http://www.springframework.org/schema/integration/file"
xmlns:int-mail="http://www.springframework.org/schema/integration/mail"
xmlns:int-jdbc="http://www.springframework.org/schema/integration/jdbc"
xsi:schemaLocation="http://www.springframework.org/schema/integration/mail http://www.springframework.org/schema/integration/mail/spring-integration-mail.xsd
http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/integration/file http://www.springframework.org/schema/integration/file/spring-integration-file.xsd
http://www.springframework.org/schema/integration/jdbc http://www.springframework.org/schema/integration/jdbc/spring-integration-jdbc-2.2.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
唯一的非Spring Integration元素是自定义路由器和自定义转换器的2个内部bean定义:
<int:router id="myrouter" input-channel="routerInput">
<bean class="my.example.Router">
<property name="prop" ref="otherBean"/>
</bean>
</int:router>
<int:transformer input-channel="transformerInput" output-channel="OutboundMail" >
<bean class="my.example.Transformer">
<property name="prop" ref="otherBean"/>
</bean>
</int:transformer>
堆栈跟踪:
eclipse.buildId=3.6.0.201407101106-RELEASE-e44
java.version=1.7.0_45
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Framework arguments: -product org.springsource.sts.ide
Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.springsource.sts.ide
This is a continuation of log file U:\Users\fgreg\Documents\Workspace\.metadata\.bak_0.log
Created Time: 2014-08-20 07:57:08.801
org.springframework.ide.eclipse.beans.core.metadata
Error
Wed Aug 20 08:00:16 EDT 2014
Problems occurred when invoking code from plug-in: "org.springframework.ide.eclipse.beans.core.metadata".
java.lang.IllegalArgumentException: 'beanName' must not be empty
at org.springframework.util.Assert.hasText(Assert.java:162)
at org.springframework.beans.factory.config.RuntimeBeanReference.<init>(RuntimeBeanReference.java:58)
at org.springframework.beans.factory.config.RuntimeBeanReference.<init>(RuntimeBeanReference.java:46)
at org.springframework.ide.eclipse.beans.core.internal.model.AbstractBeanMethodOverride.<init>(AbstractBeanMethodOverride.java:37)
at org.springframework.ide.eclipse.beans.core.internal.model.BeanLookupMethodOverride.<init>(BeanLookupMethodOverride.java:24)
at org.springframework.ide.eclipse.beans.core.internal.model.Bean.initBean(Bean.java:373)
at org.springframework.ide.eclipse.beans.core.internal.model.Bean.getProperty(Bean.java:192)
at org.springframework.ide.eclipse.data.SpringDataUtils.isRepositoryBean(SpringDataUtils.java:108)
at org.springframework.ide.eclipse.data.metadata.ui.RepositoriesBeanMetadataProvider.provideBeanMetadata(RepositoriesBeanMetadataProvider.java:52)
at org.springframework.ide.eclipse.beans.core.metadata.internal.model.BeanMetadataBuilderJob$1.run(BeanMetadataBuilderJob.java:198)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.springframework.ide.eclipse.beans.core.metadata.internal.model.BeanMetadataBuilderJob.attachMetadataToBean(BeanMetadataBuilderJob.java:191)
at org.springframework.ide.eclipse.beans.core.metadata.internal.model.BeanMetadataBuilderJob.attachMetadata(BeanMetadataBuilderJob.java:170)
at org.springframework.ide.eclipse.beans.core.metadata.internal.model.BeanMetadataBuilderJob.run(BeanMetadataBuilderJob.java:141)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
有没有人见过这个或知道如何修复它?
日志文件中的较大堆栈跟踪:
!ENTRY org.eclipse.e4.ui.workbench 4 0 2014-08-20 07:57:05.848
!MESSAGE
!STACK 0
java.lang.IllegalArgumentException: 'beanName' must not be empty
at org.springframework.util.Assert.hasText(Assert.java:162)
at org.springframework.beans.factory.config.RuntimeBeanReference.<init>(RuntimeBeanReference.java:58)
at org.springframework.beans.factory.config.RuntimeBeanReference.<init>(RuntimeBeanReference.java:46)
at org.springframework.ide.eclipse.beans.core.internal.model.AbstractBeanMethodOverride.<init>(AbstractBeanMethodOverride.java:37)
at org.springframework.ide.eclipse.beans.core.internal.model.BeanLookupMethodOverride.<init>(BeanLookupMethodOverride.java:24)
at org.springframework.ide.eclipse.beans.core.internal.model.Bean.initBean(Bean.java:373)
at org.springframework.ide.eclipse.beans.core.internal.model.Bean.getProperty(Bean.java:192)
at org.springframework.ide.eclipse.data.SpringDataUtils.isRepositoryBean(SpringDataUtils.java:108)
at org.springframework.ide.eclipse.data.SpringDataUtils.getRepositoryBeansFor(SpringDataUtils.java:130)
at org.springframework.ide.eclipse.data.SpringDataUtils.getRepositoryBeanIds(SpringDataUtils.java:67)
at org.springframework.ide.eclipse.data.beans.ui.editor.RepositoriesReferenceableElementLocator.getReferenceableElements(RepositoriesReferenceableElementLocator.java:55)
at org.springframework.ide.eclipse.beans.ui.editor.util.BeansEditorUtils.getReferenceableNodes(BeansEditorUtils.java:918)
at org.springframework.ide.eclipse.config.graph.model.AbstractConfigGraphDiagram.updateRefNodeRegistry(AbstractConfigGraphDiagram.java:342)
at org.springframework.ide.eclipse.config.graph.model.AbstractConfigGraphDiagram.refreshModelFromXml(AbstractConfigGraphDiagram.java:331)
at org.springframework.ide.eclipse.config.graph.parts.ActivityDiagramPart.refresh(ActivityDiagramPart.java:217)
at org.eclipse.gef.editparts.AbstractEditPart.addNotify(AbstractEditPart.java:253)
at org.eclipse.gef.editparts.AbstractGraphicalEditPart.addNotify(AbstractGraphicalEditPart.java:223)
at org.eclipse.gef.editparts.AbstractEditPart.addChild(AbstractEditPart.java:212)
at org.eclipse.gef.editparts.SimpleRootEditPart.setContents(SimpleRootEditPart.java:105)
at org.eclipse.gef.ui.parts.AbstractEditPartViewer.setContents(AbstractEditPartViewer.java:617)
at org.eclipse.gef.ui.parts.AbstractEditPartViewer.setContents(AbstractEditPartViewer.java:626)
at org.springframework.ide.eclipse.config.graph.AbstractConfigGraphicalEditor.initializeGraphicalViewer(AbstractConfigGraphicalEditor.java:378)
at org.eclipse.gef.ui.parts.GraphicalEditor.createGraphicalViewer(GraphicalEditor.java:158)
at org.eclipse.gef.ui.parts.GraphicalEditorWithPalette.createPartControl(GraphicalEditorWithPalette.java:63)
at org.eclipse.ui.part.MultiPageEditorPart.addPage(MultiPageEditorPart.java:243)
at org.eclipse.ui.forms.editor.FormEditor.addPage(FormEditor.java:325)
at org.eclipse.ui.part.MultiPageEditorPart.addPage(MultiPageEditorPart.java:213)
at org.eclipse.ui.forms.editor.FormEditor.addPage(FormEditor.java:308)
at org.springframework.ide.eclipse.config.ui.editors.AbstractConfigEditor.addConfigEditorPage(AbstractConfigEditor.java:237)
at org.springframework.ide.eclipse.config.ui.editors.AbstractConfigEditor.updateNamespacePages(AbstractConfigEditor.java:936)
at org.springframework.ide.eclipse.config.ui.editors.SpringConfigEditor.updateNamespacePages(SpringConfigEditor.java:189)
at org.springframework.ide.eclipse.config.ui.editors.AbstractConfigEditor.createNamespacePages(AbstractConfigEditor.java:284)
at org.springframework.ide.eclipse.config.ui.editors.AbstractConfigEditor.addPages(AbstractConfigEditor.java:253)
at org.eclipse.ui.forms.editor.FormEditor.createPages(FormEditor.java:138)
at org.eclipse.ui.part.MultiPageEditorPart.createPartControl(MultiPageEditorPart.java:362)
at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.createPartControl(CompatibilityPart.java:140)
at org.eclipse.ui.internal.e4.compatibility.CompatibilityEditor.createPartControl(CompatibilityEditor.java:99)
at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.create(CompatibilityPart.java:321)
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:55)
at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:888)
at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:869)
at org.eclipse.e4.core.internal.di.InjectorImpl.inject(InjectorImpl.java:120)
at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:337)
at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:258)
at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:162)
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:104)
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:73)
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:55)
at org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRenderer.createWidget(ContributedPartRenderer.java:127)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createWidget(PartRenderingEngine.java:983)
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:766)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$2(PartRenderingEngine.java:737)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:731)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:715)
at org.eclipse.e4.ui.internal.workbench.PartServiceImpl$1.handleEvent(PartServiceImpl.java:92)
at org.eclipse.e4.ui.services.internal.events.UIEventHandler$1.run(UIEventHandler.java:40)
at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:187)
at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:156)
at org.eclipse.swt.widgets.Display.syncExec(Display.java:4734)
at org.eclipse.e4.ui.internal.workbench.swt.E4Application$1.syncExec(E4Application.java:218)
at org.eclipse.e4.ui.services.internal.events.UIEventHandler.handleEvent(UIEventHandler.java:36)
at org.eclipse.equinox.internal.event.EventHandlerWrapper.handleEvent(EventHandlerWrapper.java:197)
at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:197)
at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:1)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
at org.eclipse.equinox.internal.event.EventAdminImpl.dispatchEvent(EventAdminImpl.java:135)
at org.eclipse.equinox.internal.event.EventAdminImpl.sendEvent(EventAdminImpl.java:78)
at org.eclipse.equinox.internal.event.EventComponent.sendEvent(EventComponent.java:39)
at org.eclipse.e4.ui.services.internal.events.EventBroker.send(EventBroker.java:81)
at org.eclipse.e4.ui.internal.workbench.UIEventPublisher.notifyChanged(UIEventPublisher.java:59)
at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:374)
at org.eclipse.e4.ui.model.application.ui.impl.ElementContainerImpl.setSelectedElement(ElementContainerImpl.java:171)
at org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer$10.widgetSelected(StackRenderer.java:1035)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:248)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4353)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1061)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1085)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1070)
at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:782)
at org.eclipse.swt.custom.CTabFolder.setSelection(CTabFolder.java:3110)
at org.eclipse.swt.custom.CTabFolder.onMouse(CTabFolder.java:1794)
at org.eclipse.swt.custom.CTabFolder$1.handleEvent(CTabFolder.java:283)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4353)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1061)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4172)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3761)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:382)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:236)
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:648)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
at org.eclipse.equinox.launcher.Main.main(Main.java:1438)
答案 0 :(得分:1)
嗯,我采取核方法似乎解决了问题。我做了两件似乎导致解决问题的事情,我不确定哪一个在解决问题方面有更大的影响:
<int:router id="myrouter" input-channel="routerInput">
<bean class="my.example.Router" name="router">
<property name="prop" ref="otherBean"/>
</bean>
</int:router>
<int:transformer input-channel="transformerInput" output-channel="OutboundMail" >
<bean class="my.example.Transformer" name="transformer">
<property name="prop" ref="otherBean"/>
</bean>
</int:transformer>
我想加上这个名字&#39;到内部bean是什么做了所以我删除了属性,然后重新启动,看看是否会再次出现错误。它没有再出现。所以这可能是做这两件事的组合,也可能是用掉了.settings文件。