Announcement Announcement Module
Collapse
No announcement yet.
include child spring config files in master config file Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • 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.

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

    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

    Code:
    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.

    Thanks,
    Kelumt

  • #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.

    Comment

    Working...
    X