Results 1 to 3 of 3

Thread: Loading multiple beans.xml with XmlWebApplicationContext

Hybrid View

  1. #1

    Default Loading multiple beans.xml with XmlWebApplicationContext

    In my web.xml

    Code:
    <context-param>
    		<param-name>contextConfigLocation</param-name>
    		<param-value>
    			/WEB-INF/simple-servlet.xml,
                            /WEB-INF/simple-dao.xml,
                            /WEB-INF/simple-utilities.xml
    		</param-value>
    </context-param>
    	
    <listener>
    		<listener-class>
    			org.springframework.web.context.ContextLoaderListener
    		</listener-class>
    </listener>
    It seems loading multiple bean definition XML files does not work the way I expect. The last loaded XML file seems to overwrite all previous loaded XML files. In above example, the simple-utilities.xml would overwrite all other definitions defined in simple-dao.xml and simple-servlet.xml. Another word, anything defined in both simple-dao.xml and simple-servlet.xml disappear after simple-utilities.xml is loaded, or may be there is a bug in the XmlWebApplicationContext that prevent multiple bean definition files from loading properly.

    I am using the latest stable spring 3.0 release. (This is not an issue with Java base Config. @Configuration annotated class can successfully load multiple xml files)
    Is this a correct behavior?
    Last edited by zollen; Feb 15th, 2010 at 01:43 PM.

  2. #2

    Default [SOLVED] oops! my mistake

    Configuration error fixed.

  3. #3
    Join Date
    Jun 2009
    Posts
    190

    Default

    Hi,

    It would be helpful to others if you share what mistake was done by you.

    -Hetal

Posting Permissions

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