使用< import>?时,发现Spring / Eclipse'未找到引用的bean'警告 [英] Spring/Eclipse 'referenced bean not found' warning when using <import>?

查看:190
本文介绍了使用< import>?时,发现Spring / Eclipse'未找到引用的bean'警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚将一个Spring bean配置文件分解成较小的外部文件,并使用import指令将它们包含在我的Spring Test应用程序上下文XML文件中。



但是,无论何时从导入的文件中引用其中一个bean,我在Eclipse / STS / Spring XML编辑器中收到一个警告,指出未找到引用的beanfoo



这是个bug还是我的错?这真的很烦人,因为我不想禁用警告,但在我公司,我们试图消除所有的警告。

解决方案

这真的让我感到烦恼了



我不是确定当这个功能被介绍,但是随着更新的版本,可以添加这个支持。


  1. 在Spring资源管理器视图中右键单击你的项目

  2. 点击属性

  3. 请看下图:



我不明白为什么默认情况下没有检查,但是在启用它之后,它的作用就像一个魅力!



如果您的版本没有此选项,我强烈建议下载SpringSource的 STS ,并附上所有必需的Eclipse插件。


I have just broken up a Spring bean configuration file into smaller external files and have used the the "import" directive to include them in my Spring Test application context XML file.

But whenever I reference one of the beans from the imported files I get a warning within Eclipse/STS/Spring XML editor complaining that "referenced bean 'foo' not found"

Is this is a bug or is it me? It's really annoying because I don't want to disable the warning, yet at my company we try to eliminate all warnings.

解决方案

It really annoyed me too!

I'm not sure when this feature was introduced, but with later versions it's possible to add this support.

  1. Right click on your project in the Spring explorer view
  2. Click on properties
  3. See image below:

I don't understand why it's not checked by default, but it works like a charm after you have enabled it!

If you don't have this option with your version, I will highly recommend to download SpringSource's STS with all necessary Eclipse plugins bundled.

这篇关于使用< import>?时,发现Spring / Eclipse'未找到引用的bean'警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆