Results 1 to 3 of 3

Thread: Referencing an annotated bean from a XML one

  1. #1
    Join Date
    Jun 2006
    Posts
    13

    Default 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.

    Anyway.
    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.

    Cheers

  2. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,632

    Default

    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.
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  3. #3
    Join Date
    Dec 2008
    Location
    India
    Posts
    295

    Default

    Spring support both mixing of xml and annotations, may be you are not pointing to correct one, Check DI first
    Enjoy
    Rohan Chauhan
    ------------------------------------------------------------------------------
    SpringSource Certified Spring 3.0 Professional


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •