Announcement Announcement Module
No announcement yet.
Referencing an annotated bean from a XML one Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Referencing an annotated bean from a XML one

    I can't see why this shouldln't be possible but I am always getting a null reference.

    One Service configured with the @Service annotation and all other annotated beans successfully get a reference using the @Autowired annotation.

    We also have some older beans configured in XML (currently moving to annotations but doing a few at a time) and this bean needs to reference the first service bean above.

    So, is this possible? I really can't see why it shouldn't, but no matter what I do the reference to the first bean in the second is always null.

    If it is possible, I will continue banging my head to find whats wrong. But thought I'd ask just in case.


  • #2
    Should be no problem at all, as long as you use the correct name in the reference and make sure it references the correct name.


    • #3
      Spring support both mixing of xml and annotations, may be you are not pointing to correct one, Check DI first