Spring/Eclipse 'referenced bean not found' warning when using ?

前端 未结 3 458
暗喜
暗喜 2020-12-09 16:44

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 c

3条回答
  •  情书的邮戳
    2020-12-09 17:28

    According to this thread, this could be similar to:

    I have an (admittedly cosmetic) issue with the Spring IDE plugins for Eclipse that I've not been able to solve. I have a situation in which context files A and B are both imported by context C. B makes use of several beans defined in A, but since they're never used independently (only by C), this isn't a problem.

    However, the Spring IDE plugin validator marks all of the references to beans in A in context file B as errors, saying something like "Referenced bean 'foo' not found bar.xml". Obviously this is a correct statement, but in my use case it's not an error.

    there are two ways of solving this issue:

    1. Only configure context C with Spring IDE and let the other files (A. B) handled by the import support. Doing so will not create the warning. Make sure that you don't add A and B as config files to Spring IDE as they would also be validated stand-alone which causes the validation error you are seeing.
    2. Configure a Config Set for A, B, and C and don't enable Import processing for the project.

提交回复
热议问题