Results 1 to 3 of 3

Thread: Order of loading context xml files

Hybrid View

  1. #1
    Join Date
    Jan 2012
    Posts
    4

    Default Order of loading context xml files

    Hi All,

    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.

    Thanks

  2. #2

    Default

    Spring reference does a pretty good job explaining it. Often times its not necessary as spring is able to figure out dependencies on its own or by using the ref attribute.

    http://static.springsource.org/sprin...tory-dependson

  3. #3
    Join Date
    Jan 2012
    Posts
    4

    Default

    Thanks for your reply... any idea how spring does it on its own.. like it should have some kind of algorithm it should be following to load the beans from the context files.

    I would like to have an idea on it.Will try to google it and see if i can get anything on that.

    Regards

Tags for this Thread

Posting Permissions

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