Order of loading context xml files
I have multiple spring context files with beans declared in it.Some of the beans declared are interdependent between the XMLs. For example there is a bean declared in contextfile A is given as a reference on a contextxml file B.
The context files are present in META-INF/spring folder as I am deploying that as a OSGi bundle in virgo server.
My question is
How spring decides on the order of loading the the xml files?
I faced an error (bean reference error) while deploying this to one of the virgo server and no error on the 2nd instance of the virgo server.
I used import to load the context files in the order i prefer and that eliminated the error.
Will using "depends-on" attribute while declaring the beans solve the error with multiple context xml files?
Any suggestions on this is appreciated.