Why does Spring's @Configurable sometimes work and sometimes not?

前端 未结 6 1529
感情败类
感情败类 2020-12-16 18:05

I\'m trying to use automatic dependency injection via Spring\'s @Configurable annotation w/ @Resource on the fields needing injection. This involved some setup, like passing

6条回答
  •  孤城傲影
    2020-12-16 19:01

    To me it sounds like an occurence of a well known bug in Spring: http://jira.springframework.org/browse/SPR-5401.

    Can it be that you are trying to use Configurable in several application contexts? In this case only one of them will be subject to dependency injection. Which one wins depends on which application context is the last one to be loaded.

    Solution? None :-( There are no plans to fix this issue. That is at least what the SpringSource guy told at the JAX conference in Germany in April.

提交回复
热议问题