title: Configuration 'prob lem': Failed to import bean definitions from URL location
body: <p>I'm trying to create new spring mvc project using maven.
  <strong>[NOTE: everything is in eclipse only, maven plugin to create new maven project, server also embedded]</strong>
  After doing maven build I run my project using tomcat server.
  what i'm getting is :</p>
  
  <p><strong>console log:</strong></p>
  
  <pre><code>Jun 11, 2014 4:11:28 PM org.apache.coyote.AbstractProtocol start
  INFO: Starting ProtocolHandler ["http-bio-9090"]
  Jun 11, 2014 4:11:28 PM org.apache.coyote.AbstractProtocol start
  INFO: Starting ProtocolHandler ["ajp-bio-8009"]
  Jun 11, 2014 4:11:28 PM org.apache.catalina.startup.Catalina start
  INFO: Server startup in 4377 ms
  Jun 11, 2014 4:11:28 PM org.apache.catalina.core.ApplicationContext log
  INFO: Initializing Spring FrameworkServlet 'springDispatcher'
  Jun 11, 2014 4:11:29 PM org.apache.catalina.core.ApplicationContext log
  SEVERE: StandardWrapper.Throwable
      org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from relative location [datasourceConfig.xml]
      Offending resource: class path resource [springconfigs/springDispatcher-servlet.xml]; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [springconfigs/datasourceConfig.xml]; nested exception is java.net.ConnectException: Connection refused: connect
          at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:70)
          at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85)
          at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:76)
          at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.importBeanDefinitionResource(DefaultBeanDefinitionDocumentReader.java:274)
          at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseDefaultElement(DefaultBeanDefinitionDocumentReader.java:199)
          at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:184)
          at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.doRegisterBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:141)
          at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:110)
          at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:508)
          at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:391)
          at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:335)
          at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:303)
          at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180)
          at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:216)
          at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:187)
          at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:125)
          at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:94)
          at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:129)
          at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:540)
          at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:454)
          at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:643)
          at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:606)
          at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:657)
          at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:525)
          at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:466)
          at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136)
          at javax.servlet.GenericServlet.init(GenericServlet.java:160)
          at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1266)
          at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1185)
          at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:857)
          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:136)
          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
          at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
          at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1002)
          at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)
          at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
          at java.lang.Thread.run(Thread.java:722)
      Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [springconfigs/datasourceConfig.xml]; nested exception is java.net.ConnectException: Connection refused: connect
          at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:409)
          at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:335)
          at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:303)
          at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.importBeanDefinitionResource(DefaultBeanDefinitionDocumentReader.java:258)
          ... 39 more
      Caused by: java.net.ConnectException: Connection refused: connect
          at java.net.DualStackPlainSocketImpl.connect0(Native Method)
          at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:69)
          at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
          at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
          at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
          at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:157)
          at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:391)
          at java.net.Socket.connect(Socket.java:579)
          at java.net.Socket.connect(Socket.java:528)
          at sun.net.NetworkClient.doConnect(NetworkClient.java:180)
          at sun.net.www.http.HttpClient.openServer(HttpClient.java:378)
          at sun.net.www.http.HttpClient.openServer(HttpClient.java:473)
          at sun.net.www.http.HttpClient.&lt;init&gt;(HttpClient.java:203)
          at sun.net.www.http.HttpClient.New(HttpClient.java:290)
          at sun.net.www.http.HttpClient.New(HttpClient.java:306)
          at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:995)
          at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:931)
          at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:849)
          at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1299)
          at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:632)
          at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startEntity(XMLEntityManager.java:1270)
          at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startDTDEntity(XMLEntityManager.java:1237)
          at com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.setInputSource(XMLDTDScannerImpl.java:260)
          at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.dispatch(XMLDocumentScannerImpl.java:1153)
          at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.next(XMLDocumentScannerImpl.java:1049)
          at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:962)
          at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:607)
          at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:489)
          at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:835)
          at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
          at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:123)
          at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:237)
          at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:300)
          at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:76)
          at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadDocument(XmlBeanDefinitionReader.java:428)
          at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390)
          ... 42 more
  
      Jun 11, 2014 4:11:29 PM org.apache.catalina.core.StandardWrapperValve invoke
      SEVERE: Allocate exception for servlet springDispatcher
      java.net.ConnectException: Connection refused: connect
          at java.net.DualStackPlainSocketImpl.connect0(Native Method)
          at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:69)
          at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
          at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
          at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
          at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:157)
          at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:391)
          at java.net.Socket.connect(Socket.java:579)
          at java.net.Socket.connect(Socket.java:528)
          at sun.net.NetworkClient.doConnect(NetworkClient.java:180)
          at sun.net.www.http.HttpClient.openServer(HttpClient.java:378)
          at sun.net.www.http.HttpClient.openServer(HttpClient.java:473)
          at sun.net.www.http.HttpClient.&lt;init&gt;(HttpClient.java:203)
          at sun.net.www.http.HttpClient.New(HttpClient.java:290)
          at sun.net.www.http.HttpClient.New(HttpClient.java:306)
          at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:995)
          at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:931)
          at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:849)
          at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1299)
          at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:632)
          at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startEntity(XMLEntityManager.java:1270)
          at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startDTDEntity(XMLEntityManager.java:1237)
          at com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.setInputSource(XMLDTDScannerImpl.java:260)
          at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.dispatch(XMLDocumentScannerImpl.java:1153)
          at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.next(XMLDocumentScannerImpl.java:1049)
          at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:962)
          at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:607)
          at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:489)
          at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:835)
          at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
          at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:123)
          at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:237)
          at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:300)
          at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:76)
          at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadDocument(XmlBeanDefinitionReader.java:428)
          at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390)
          at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:335)
          at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:303)
          at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.importBeanDefinitionResource(DefaultBeanDefinitionDocumentReader.java:258)
          at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseDefaultElement(DefaultBeanDefinitionDocumentReader.java:199)
          at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:184)
          at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.doRegisterBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:141)
          at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:110)
          at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:508)
          at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:391)
          at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:335)
          at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:303)
          at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180)
          at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:216)
          at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:187)
          at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:125)
          at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:94)
          at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:129)
          at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:540)
          at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:454)
          at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:643)
          at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:606)
          at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:657)
          at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:525)
          at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:466)
          at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136)
          at javax.servlet.GenericServlet.init(GenericServlet.java:160)
          at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1266)
          at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1185)
          at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:857)
          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:136)
          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
          at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
          at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1002)
          at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)
          at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
          at java.lang.Thread.run(Thread.java:722)
  </code></pre>
  
  <p><strong>springDispatcher-servlet.xml file</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xmlns:mvc="http://www.springframework.org/schema/mvc" 
              xmlns:context="http://www.springframework.org/schema/context"
              xmlns="http://www.springframework.org/schema/beans"
              xsi:schemaLocation="
                  http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
                  http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
                  http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd"&gt;
  
      &lt;context:component-scan base-package="com.name.*" /&gt;
  
      &lt;mvc:annotation-driven /&gt;
  
      &lt;import resource="datasourceConfig.xml" /&gt;
      &lt;import resource="applicationContext.xml" /&gt;
  
      &lt;!-- view resolver --&gt;
      &lt;bean
                          class="org.springframework.web.servlet.view.InternalResourceViewResolver"&gt;
          &lt;property name="prefix" value="/WEB-INF/view/" /&gt;
          &lt;property name="suffix" value=".jsp" /&gt;
      &lt;/bean&gt;
  
      &lt;bean
                          class="org.springframework.web.servlet.view.ContentNegotiatingViewResolver"&gt;
          &lt;property name="order" value="0"&gt;
          &lt;/property&gt;
          &lt;property name="favorPathExtension" value="true"/&gt;
          &lt;property name="ignoreAcceptHeader" value="true" /&gt;
          &lt;property name="defaultContentType" value="application/json"&gt;
          &lt;/property&gt;
          &lt;property name="mediaTypes"&gt;
              &lt;map&gt;
                  &lt;entry key="htm" value="text/html" /&gt;
                  &lt;entry key="xls" value="text/html" /&gt;
                  &lt;entry key="json" value="application/json" /&gt;
              &lt;/map&gt;
          &lt;/property&gt;
  
          &lt;property name="viewResolvers"&gt;
              &lt;list&gt;
                  &lt;bean class="org.springframework.web.servlet.view.UrlBasedViewResolver"&gt;
                      &lt;property name="viewClass" value="org.springframework.web.servlet.view.JstlView" /&gt;
                      &lt;property name="prefix" value="/WEB-INF/view/" /&gt;
                      &lt;property name="suffix" value=".jsp" /&gt;
                  &lt;/bean&gt;
              &lt;/list&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
  
      &lt;!-- Resource Bundle for i18N --&gt;
      &lt;bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource"&gt;
          &lt;property name="basename" value="classpath:i18n/message_en" /&gt;
          &lt;property name="defaultEncoding" value="UTF-8" /&gt;
      &lt;/bean&gt;
      &lt;!-- JSON data handler --&gt;
      &lt;bean class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter" id="jacksonMessageConverter" /&gt;
      &lt;bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter"&gt;
          &lt;property name="messageConverters"&gt;
              &lt;list&gt;
                  &lt;ref bean="jacksonMessageConverter" /&gt;
              &lt;/list&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
      &lt;!-- Interceptor that allows for changing the current locale on every request,  via a configurable request parameter --&gt;
      &lt;mvc:interceptors&gt;
          &lt;bean id="localeChangeInterceptor" class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor"&gt;
              &lt;property name="paramName" value="lang" /&gt;
          &lt;/bean&gt;
      &lt;/mvc:interceptors&gt;
  
      &lt;!-- LocaleResolver implementation that uses a cookie sent back to the user 
                          in case of a custom setting, with a fallback to the specified default locale 
                          or the request's accept-header locale. --&gt;
      &lt;bean id="localeResolver" class="org.springframework.web.servlet.i18n.CookieLocaleResolver"&gt;
          &lt;property name="defaultLocale" value="en" /&gt;
      &lt;/bean&gt;
  &lt;/beans&gt;
  </code></pre>
  
  <p><strong>datasourceConfig.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"&gt;
  &lt;beans&gt;
      &lt;!-- PropertyPlaceholderConfigurer class to externalize the deployment details(database     details, log file path, etc) into a properties file --&gt;
      &lt;bean   class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"&gt;
          &lt;property name="location" value="classpath:database.properties" /&gt;
      &lt;/bean&gt;
  
      &lt;!-- Database datasource configurations with details fetched from database.properties   file --&gt;
      &lt;bean id="dataSource"   class="org.springframework.jdbc.datasource.DriverManagerDataSource"&gt;
          &lt;property name="driverClassName" value="${jdbc.DRIVER}" /&gt;
          &lt;property name="url" value="${jdbc.URL}" /&gt;
          &lt;property name="username" value="${jdbc.USERNAME}" /&gt;
          &lt;property name="password" value="${jdbc.PASSWORD}" /&gt;
          &lt;!-- 
          &lt;property name="driverClassName" value="com.mysql.jdbc.Driver" /&gt;
          &lt;property name="url" value="jdbc:mysql://localhost:3306/_npi?createDatabaseIfNotExist=true" /&gt;
          &lt;property name="username" value="root" /&gt;
          &lt;property name="password" value="admin" /&gt; 
          --&gt;
      &lt;/bean&gt;
  
      &lt;bean id="pool" class="org.apache.commons.pool.impl.GenericObjectPool"&gt;
          &lt;property name="minEvictableIdleTimeMillis"&gt;
              &lt;value&gt;300000&lt;/value&gt;
          &lt;/property&gt;
          &lt;property name="timeBetweenEvictionRunsMillis"&gt;
              &lt;value&gt;1000&lt;/value&gt;
          &lt;/property&gt;
          &lt;property name="maxActive"&gt;
              &lt;value&gt;-1&lt;/value&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
      &lt;bean id="dsConnectionFactory" class="org.apache.commons.dbcp.DataSourceConnectionFactory"&gt;
          &lt;constructor-arg&gt;
              &lt;ref bean="dataSource" /&gt;
          &lt;/constructor-arg&gt;
      &lt;/bean&gt;
      &lt;bean id="poolableConnectionFactory" class="org.apache.commons.dbcp.PoolableConnectionFactory"&gt;
          &lt;constructor-arg index="0"&gt;
              &lt;ref bean="dsConnectionFactory" /&gt;
          &lt;/constructor-arg&gt;
          &lt;constructor-arg index="1"&gt;
              &lt;ref bean="pool" /&gt;
          &lt;/constructor-arg&gt;
          &lt;constructor-arg index="2"&gt;
              &lt;null /&gt;
          &lt;/constructor-arg&gt;
          &lt;constructor-arg index="3"&gt;
              &lt;null /&gt;
          &lt;/constructor-arg&gt;
          &lt;constructor-arg index="4"&gt;
              &lt;value&gt;false&lt;/value&gt;
          &lt;/constructor-arg&gt;
          &lt;constructor-arg index="5"&gt;
              &lt;value&gt;true&lt;/value&gt;
          &lt;/constructor-arg&gt;
      &lt;/bean&gt;
      &lt;bean id="pooledDS" class="org.apache.commons.dbcp.PoolingDataSource"   depends-on="poolableConnectionFactory"&gt;
          &lt;constructor-arg&gt;
              &lt;ref bean="pool" /&gt;
          &lt;/constructor-arg&gt;
      &lt;/bean&gt;
  &lt;/beans&gt;
  </code></pre>
  
  <p><strong>web.xml</strong></p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xmlns="http://java.sun.com/xml/ns/javaee"
              xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
              metadata-complete="true" version="3.0"&gt;
  
      &lt;!-- Set index.jsp as home page --&gt;
      &lt;welcome-file-list&gt;
          &lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt;
      &lt;/welcome-file-list&gt;
  
      &lt;listener&gt;
          &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt;
      &lt;/listener&gt;
  
      &lt;context-param&gt;
          &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
          &lt;param-value&gt;classpath:/springconfigs/spring-security.xml&lt;/param-value&gt;
      &lt;/context-param&gt;
  
      &lt;!-- Enables Spring Security --&gt;
      &lt;filter&gt;
          &lt;filter-name&gt;springSecurityFilterChain&lt;/filter-name&gt;
          &lt;filter-class&gt;org.springframework.web.filter.DelegatingFilterProxy&lt;/filter-class&gt;
      &lt;/filter&gt;
  
      &lt;filter&gt;
          &lt;filter-name&gt;encoding-filter&lt;/filter-name&gt;
          &lt;filter-class&gt;org.springframework.web.filter.CharacterEncodingFilter&lt;/filter-class&gt;
          &lt;init-param&gt;
              &lt;param-name&gt;encoding&lt;/param-name&gt;
              &lt;param-value&gt;UTF-8&lt;/param-value&gt;
          &lt;/init-param&gt;
      &lt;/filter&gt;
  
      &lt;filter-mapping&gt;
          &lt;filter-name&gt;encoding-filter&lt;/filter-name&gt;
          &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
      &lt;/filter-mapping&gt;
  
      &lt;filter-mapping&gt;
          &lt;filter-name&gt;springSecurityFilterChain&lt;/filter-name&gt;
          &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
      &lt;/filter-mapping&gt;
  
  
      &lt;!-- DispatcherServlet is an Central dispatcher for HTTP request handlers/controllers, 
                          It is configured to delegating all requests to appropriate controller [ Command 
                          classes configured using @Controller annotation] --&gt;
      &lt;servlet&gt;
          &lt;servlet-name&gt;springDispatcher&lt;/servlet-name&gt;
          &lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet&lt;/servlet-class&gt;
          &lt;init-param&gt;
              &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
              &lt;param-value&gt;classpath:/springconfigs/springDispatcher-servlet.xml&lt;/param-value&gt;
          &lt;/init-param&gt;
          &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
      &lt;/servlet&gt;
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;springDispatcher&lt;/servlet-name&gt;
          &lt;url-pattern&gt;*.htm&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;springDispatcher&lt;/servlet-name&gt;
          &lt;url-pattern&gt;*.json&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p><strong>my web structure</strong>
      project :{src/main/java,src/main/resources:{springconfigs:{springDispacture-servlet.xml,applicationContext.xml,dataSource.xml}}WebContent:{WEB-INF:{ web.xml}}}</p>
  
  <p><strong>pom.xml</strong></p>
  
  <pre><code>    ....
  &lt;build&gt;
      &lt;plugins&gt;
          &lt;!-- Tomcat 7 plugin --&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.tomcat.maven&lt;/groupId&gt;
              &lt;artifactId&gt;tomcat7-maven-plugin&lt;/artifactId&gt;
              &lt;version&gt;${tomcat7.maven.plugin.version}&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;port&gt;8080&lt;/port&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  </code></pre>
  
  <p><strong>[note: word is limited so can't post whole pom.xml so only tomcat build plugin config is showing to u all.]</strong></p>