Announcement Announcement Module
No announcement yet.
include child spring config files in master config file Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • include child spring config files in master config file

    Hi Guys,

    suppose I have a master Spring config file called master.xml and i have child config file called child1.xml.

    and i want to include child1.xml in master.xml as follows.

        <beans:import resource="classpath:child1.xml" />

    So far it works fine for me. then i tried to inject spring component defined in master.xml to component defined in child1.xml. then i got an error saying

    Error creating bean with name 'org.springframework.integration.config. etc.....
    but other way around works fine. that means i was able to inject a component define in child1.xml to component defined in master.xml.

    how actually these included xml files instantiate beans? is there any particular way and order?

    appreciate your help.


  • #2
    I don't think that would cause any issue because all the bean definitions from various configuration files are merged together and processed. Therefore there's no reason that the bean definitions in child configuration file can't refer to the beans defined in parent or any other configuration file. You need to provide details of your configuration so I can take a look and diagnose the problem.