Multiple Context Config files not working in Tomcat
I'm trying to get Spring 1.2 configured with Tomcat 5.0.27 and I cannot seem to get mulitple context files working. I have 3 context files:
dataAccessContext.xml
applicationContext.xml
controller-servlet.xml
I define these in my web.xml file as:
Code:
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/dataAccessContext.xml
/WEB-INF/applicationContext.xml
/WEB-INF/controller-servlet.xml
</param-value>
</context-param>
I also have defined the ContextLoaderListener in my web.xml as
Code:
<servlet>
<servlet-name>context</servlet-name>
<servlet-class>org.springframework.web.context.ContextLoaderListener</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
While trying to access my MVC application I get errors saying that some of the objects should appear in the document
"nested exception is org.xml.sax.SAXParseException: An element with the identifier "userDAO" must appear in the document."
I have my userDAO defined in my dataAccessContext.xml file and referenced in my applicationContext.xml file
I can get everything working if I mash it all into the controller-servlet.xml file but that is a huge mess. Does anyone have clues on what I'm doing wrong?