【发布时间】:2014-02-14 05:02:29
【问题描述】:
我的应用程序从两个 XML 文件加载 Spring bean 定义:
String[] beandefs = new String[] {
"commonConfig.xml",
"specificConfig.xml"
};
ApplicationContext context = new ClassPathXmlApplicationContext(
beandefs);
这是因为commonConfig.xml 包含我想要在所有部署中使用的定义。 specificConfig.xml 具有我在测试部署中替换为其他实现的定义。
这很好用,除了一个 bean 引用另一个文件中的另一个 bean 时,Eclipse (STS) 会用警告标记它。
例如如果commonConfig.xml 包含:
<bean id="foo" class="com.example.Foo">
<property name="bar" ref="bar" />
</bean>
...和specificConfig.xml 包含:
<bean id="bar" class="com.example.Bar">
...
</bean>
应用程序运行良好,但 Eclipse 在commonConfig.xml 发出警告:
Referenced bean 'bar' not found.
如何让 Eclipse 查看这两个文件?
【问题讨论】:
标签: eclipse spring spring-tool-suite