Results 1 to 3 of 3

Thread: Referencing bean in other XML file

  1. #1

    Default Referencing bean in other XML file

    I have two configuration files, applicationContext.xml and dispatcher-servlet.xml. I'm referencing a bean defined in one file from the other. I'm using the "ref bean=" syntax (not local). Anything else I need to do to get this to work? The stack trace is telling me that it can't resolve the reference and then listing out all the bean names defined locally (as if that is the only place it's looking).

    applicationContext.xml
    <bean id="bean1" class="...
    </bean>

    dispatcher-servlet.xml:
    <bean id="bean2" class="...
    <property name="b1"><ref bean="bean1"/></property>
    </bean>

  2. #2
    Join Date
    Aug 2004
    Location
    Montréal, Canada
    Posts
    845

    Default

    how do you load your applicationContext.xml?
    Omar Irbouh

    Spring Modules Team
    http://irbouh.blogspot.com/

  3. #3

    Default

    Well, I'm not. And that just could be the problem. ;-) Seriously, your question pointed me to the right part of the doc to review. thanks.

Similar Threads

  1. Order of Bean definitions matters?
    By cfuser in forum Container
    Replies: 2
    Last Post: Oct 21st, 2005, 10:29 AM
  2. Spring container fails with no exception
    By naor in forum Container
    Replies: 9
    Last Post: Oct 1st, 2005, 03:39 PM
  3. EHCaching Hibernate
    By dencamel in forum Data
    Replies: 3
    Last Post: Sep 6th, 2005, 09:03 PM
  4. could not satisfy dependencies
    By springuser in forum Container
    Replies: 4
    Last Post: Apr 26th, 2005, 01:15 PM
  5. Replies: 1
    Last Post: Apr 25th, 2005, 07:37 PM

Posting Permissions

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