i have error to define 2 seperate Spring XML config files in web.xml that cuase error .
my web.xml files is :
<web-app>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListe ner
</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/config/spring/mvc-controllers.xml
,/WEB-INF/config/spring/mvc-setting.xml
</param-value>
</context-param>
<servlet>
<servlet-name>mymvc</servlet-name>
<servlet-class>
org.springframework.web.servlet.DispatcherServlet
</servlet-class>
<load-on-startup>0</load-on-startup>
</servlet>
<servlet-mapping >
<servlet-name>mymvc</servlet-name>
<url-pattern>*.htm</url-pattern>
</servlet-mapping>
</web-app >
*******************
my two xml files is exist and if i rename it to wrong names my tomcat 5.5 get me error that cann't find these files , so this files is be found bye spring listener with true name and path.
but Although i setup 2 files for spring listener , spring context still try to find default spring config file in /WEB-INF/mymvc-servlet.xml !!! with this error on start up (my stack trace) :
[ERROR] 14:28:28 DispatcherServlet - Context initialization failed
org.springframework.beans.factory.BeanDefinitionSt oreException: IOException parsing XML document from ServletContext resource [/WEB-INF/mymvc-servlet.xml]; nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/mymvc-servlet.xml]
java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/mymvc-servlet.xml]
at org.springframework.web.context.support.ServletCon textResource.getInputStream(ServletContextResource .java:99)
at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.loadBeanDefinitions(XmlBeanDefinitionR eader.java:167)
at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.loadBeanDefinitions(XmlBeanDefinitionR eader.java:148)
at org.springframework.beans.factory.support.Abstract BeanDefinitionReader.loadBeanDefinitions(AbstractB eanDefinitionReader.java:129)
at org.springframework.beans.factory.support.Abstract BeanDefinitionReader.loadBeanDefinitions(AbstractB eanDefinitionReader.java:145)
at org.springframework.web.context.support.XmlWebAppl icationContext.loadBeanDefinitions(XmlWebApplicati onContext.java:126)
at org.springframework.web.context.support.XmlWebAppl icationContext.loadBeanDefinitions(XmlWebApplicati onContext.java:94)
at org.springframework.context.support.AbstractRefres hableApplicationContext.refreshBeanFactory(Abstrac tRefreshableApplicationContext.java:89)
at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:262)
at org.springframework.web.context.support.AbstractRe freshableWebApplicationContext.refresh(AbstractRef reshableWebApplicationContext.java:139)
at org.springframework.web.servlet.FrameworkServlet.c reateWebApplicationContext(FrameworkServlet.java:3 06)
at org.springframework.web.servlet.FrameworkServlet.i nitWebApplicationContext(FrameworkServlet.java:251 )
at org.springframework.web.servlet.FrameworkServlet.i nitServletBean(FrameworkServlet.java:220)
at org.springframework.web.servlet.HttpServletBean.in it(HttpServletBean.java:112)
at javax.servlet.GenericServlet.init(GenericServlet.j ava:211)
at org.apache.catalina.core.StandardWrapper.loadServl et(StandardWrapper.java:1003)
at org.apache.catalina.core.StandardWrapper.load(Stan dardWrapper.java:836)
at org.apache.catalina.core.StandardContext.loadOnSta rtup(StandardContext.java:3823)
at org.apache.catalina.core.StandardContext.start(Sta ndardContext.java:4128)
at org.apache.catalina.startup.HostConfig.checkResour ces(HostConfig.java:1044)
at org.apache.catalina.startup.HostConfig.check(HostC onfig.java:1136)
at org.apache.catalina.startup.HostConfig.lifecycleEv ent(HostConfig.java:292)
at org.apache.catalina.util.LifecycleSupport.fireLife cycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.StandardHost.backgroundPr ocess(StandardHost.java:729)
at org.apache.catalina.core.ContainerBase$ContainerBa ckgroundProcessor.processChildren(ContainerBase.ja va:1511)
at org.apache.catalina.core.ContainerBase$ContainerBa ckgroundProcessor.processChildren(ContainerBase.ja va:1520)
at org.apache.catalina.core.ContainerBase$ContainerBa ckgroundProcessor.run(ContainerBase.java:1500)
at java.lang.Thread.run(Thread.java:595)
please help me if you have idea about my problem
note : use servlet or listener didn't help me to solve this problem.