Already defined in the web.xml the location for dispatcher servlet as [/WEB-INF/config/dispatcher-servlet.xml] in the context-param, still why it is looking for [/WEB-INF/dispatcher-servlet.xml].
This will work when putiing the dipatcher-servlet at [/WEB-INF/config/dispatcher-servlet.xml] as well as at [/WEB-INF/dispatcher-servlet.xml] then only it is working.
How it is behaving in such a way ? If changing its current location to [/WEB-INF/config/dispatcher-servlet.xml] why it search at this [/WEB-INF/dispatcher-servlet.xml] location also ?
web.xml
<servlet>
<servlet-name>dispatcher</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>dispatcher</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/config/dispatcher-servlet.xml,
/WEB-INF/config/spring-security.xml,
/WEB-INF/config/database-config.xml
</param-value>
</context-param>
Error:
May 01, 2016 3:55:49 AM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring FrameworkServlet 'dispatcher'
2016-05-01 03:55:49 INFO DispatcherServlet:488 - FrameworkServlet 'dispatcher': initialization started
2016-05-01 03:55:49 INFO XmlWebApplicationContext:578 - Refreshing WebApplicationContext for namespace 'dispatcher-servlet': startup date [Sun May 01 03:55:49 IST 2016]; parent: Root WebApplicationContext
2016-05-01 03:55:49 INFO XmlBeanDefinitionReader:317 - Loading XML bean definitions from ServletContext resource [/WEB-INF/dispatcher-servlet.xml]
May 01, 2016 3:55:49 AM org.apache.catalina.core.ApplicationContext log
SEVERE: StandardWrapper.Throwable
org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from ServletContext resource [/WEB-INF/dispatcher-servlet.xml]; nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/dispatcher-servlet.xml]
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:344)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:304)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:181)